Monday, October 1, 2012

Public Git Repository

Initially CVS (concurrent versions system) was used for this project and the repository was converted to git using the git cvsimport command.  Before making the git repository public, I wanted to correct some issues that occurred during the conversion, specifically branches were not converted correctly.  Merges to the trunk (CVS nomenclature) did not show correctly as a merge to master (git nomenclature) - in fact there was no actual merge, just a hanging branch which a merge commit from where the branch first branched off the master branch.

These issues plus several other issues were corrected and the public git can now be accessed at github, where the repository can be explored, including the commits, source files, and branches.  Hit the Continued... for more details of the repairs.  There is also a Wiki on github, but for now it only points back to here.  The current branch is cmake0.1.16 (which is off of the branch0.1.16 development branch, but the CMAKE implementation is not quite finished yet).  Next up, some details on my current Linux development platform (there have been some changes).


Repository Repair Details:

Version 0.1.14 was the first to use a development branches.  There were 40+ commits on this branch before the merge, but there were only 2 commits in the converted repository.  While low lever git commands could have been used to repair these merges, this would have been extremely involved and it still didn't solve this issue of the missing commits.

In git, merges are known as fast-forward if no commits have been made to the master branch before the merge.  Fast-forward simply means that the master branch (pointer) is set to the point of the end of the branch; no actual "merge" commit is made.  Both the branch0.1.14 and branch0.1.15 branches were of this type, and so far, so are the branch0.1.16 and cmake0.1.16 branches.

So the easiest way to repair the repository was to just rebuild these commits starting with branch0.1.14.  Patch files were created from the CVS repository using the cvs diff command on each file of the CVS commit and applied to the git repository using the patch command.  The git commit command has an option for setting the time-stamp of the commit (the --date option), so as these commits were re-entered, the original commit dates were used.

A specific time-stamp can also be set on release tag, not as an option to the git tag command, but setting the GIT_COMMITTER_DATE environment variable first.  Times as close to the actual tag date were used since CVS does not associate a time-stamp with tags.

There were a few other edits performed to the entire repository including removing all the CVS tags (in the form '$Id:' with a version and time-stamp) as they have no place in git.  All the files were placed in Unix format (new line only) except for the old .vpj (the VIDE project files) and the regression test batch file used for testing on Windows were kept in DOS format (CRLF).  Git is supposed to handle extracting the correct file format automatically for the platform, but the process has not yet been tested on Windows.  This will be tackled shortly.

Once branch0.1.14 was repaired and merged to master at Release 0.1.14, the commits of branch0.1.15 were added from the git repository (since no 0.1.15 commits were missing) using the git cherry-pick command for each commit.  The same process was used for branch0.1.16 and cmake0.1.16 branches.  Once completed, there were several copies of commits and duplicated (and older) branches in the repository.  The obsolete commits were removed by creating a bare initialized repository, setting it as a remote to the repository and only pushing the current branches to this new repository.  This new bare repository was cloned and pushed to the github repository.

It is doubtful that all the files at each git commit match the same CVS commits.  There were some obvious errors at several of the CVS commits that were also repaired.  Starting with Release 0.1.14-pre-1 up through Release 0.1.15, the files at the tags (i.e. releases) were compared to what was posted at Sourceforge to make sure they matched (less the obvious CVS tags that were deleted).

There are also many commits where the code does not compile or run.  In the future, only code that compiles will be committed.  It was verified that the commits repaired at least compile at each of the tags.  Earlier releases were not checked since I no longer had the VIDE2 program installed.  For some of the early commits, a temporary make file was used before the actual make file was implemented (which first appeared during the 0.1.14-pre-3 development).

No comments:

Post a Comment

All comments and feedback welcomed, whether positive or negative.
(Anonymous comments are allowed, but comments with URL links or unrelated comments will be removed.)