Friday, October 5, 2012

Obtain IBCP Repository on Windows

There are two ways to obtain the IBCP repositories on Windows.  The first is using the MSYS command line, simply use the git clone command the same as on Linux:
git clone https://github.com/thunder422/ibcp.git
The second is using the Git GUI, first start the GUI by selecting Start, All Programs, Git, Git GUI.  Select Clone Existing Repository.  Enter https://github.com/thunder422/ibcp.git in the Source Location.  Enter C:/MinGW/msys/1.0/home/username (where username is your user name) in the Target Directory (or browse you MSYS home directory and add "/ibcp" to the end in the Target Directory entry, but don't use the Make New Folder in the location browser dialog to create the ibcp directory or an error will cloning).  Now click the Clone button.

Once the repository is cloned, the Git Gui (ibcp) window is presented, which will be mostly empty and just below the menu bar, there is a line that has the Current Branch: master indicating the current branch.  While it doesn't appear that anything was downloaded, you can see the repository by selecting Visualize All Branch History in the Repository menu.  This will start the gitk GUI.

From the gitk GUI, all the commits are in the upper pane, the differences of the currently selected commit is shown in the lower left pane and the files modified for this commit is shown in the lower right pane.  Though not obvious, the sizes of each pane can be adjusted by maneuvering the mouse cursor to the area between the panes until the mouse changes to the double arrow, then click, hold and drag to the desired size.  For the upper and lower panes, this area is between the Find next/prev line (used for finding commits) and the Search line (for searching the differences).  The sizes of the three columns in the upper pane can also be adjusted.

The gitk GUI also has several options for searching through the commits and how to display the differences.  Next up, building on Windows...

Windows Prerequisites For IBCP+Git

A couple of programs need to be installed on Windows to be able to obtain and build the IBCP program.  Instructions for both Windows XP (32-bit) and Windows 7 (64-bit) will be given - adjust accordingly for other versions (these are the two versions of Windows I have available).

First the MinGW (Minimalist GNU for Windows) package needs to be installed.  The version I am using, which is the latest as of this date, can be obtained from Sourceforge/MinGW.  Download and run the mingw‑get‑inst-20120426.exe installer.  In the installer, use the defaults (especially "Use pre-packaged repository catalogs" on the third dialog).  On the seventh dialog "Select Components", select C++ Compiler, MSYS Basic System, and MinGW Developer Toolkit in addition to the C Compiler.  This will download and install the GCC and MSYS programs.  The version of GCC installed is 4.6.2 (close to the version 4.6.3 on Mint 13).

Next, the Git for Windows package needs to be installed.  The Git‑1.7.11‑preview20120710.exe installer can be downloaded from msysgit Downloads.  When installing this program at the Select Components dialog, under Windows Explorer integration select Simple context menu to install Git Bash and Git GUI.  Select the defaults for the rest of the dialogs.

Now the git package needs to be integrated with the MSYS package.  All that is necessary is that the PATH environment variable needs to be modified to include where the git programs are installed.  For Windows XP, this is C:Program Files/Git/bin and for Windows 7, this is C:Program Files (x86)/Git/bin.  Within the MSYS command line, edit the file /etc/profile (or with Notepad - the file is located at C:\MinGW\msys\1.0\etc\profile) and add the following line after all other lines that modify PATH:
Windows XP: export PATH="$PATH:/c/Program Files/Git/bin"
Windows 7:   export PATH="$PATH:/c/Program Files (x86)/Git/bin"
(Update October 6, 2012) In order for the "/c" part to work in MSYS, the /etc/fstab (C:\MinGW\msys\1.0\etc\fstab) file system table file needs to be modified by adding a new line containing "C:\  /c" to give access to the entire C drive.

If necessary, restart the MSYS command window, and confirm git is there by using the git ‑‑version command within the MSYS command window.  Next up, obtaining the IBCP repository on Windows.