Re: CVS <--> GIT workflow...
Yes, git-cvsexportcommit has to be told explicitly which commits to export. It will only check that they seem to be sane, in that they will apply cleanly.
Currently I presume everyone has to roll their own solution to this. In my case, with the absence of any available prior art, I wrote a wrapper script, in an attempt to simplify the process to 'git-cvs push' and 'git-cvs pull'. See my earlier post to this list:
http://article.gmane.org/gmane.comp.version-control.git/120351
This works for me for basic day-to-day interaction with my CVS repository, which has over a year's work in it, although there are times when I still need to manually intervene.
If you do try it I'd be interested hear how well it works, especially if it means I can improve it. Currently it doesn't have a lot of documentation besides what's in the script itself, but if I could be encouraged to write more if asked nicely.
Note, you probably also want a step 5 before cycling back to step 3: use git-cvsimport to incrementally import your exported commits back into git. If this succeeds, git-cvsimport will also merge the remote CVS branch with your local one - like this, where c' and d' are the re-imported copies of commits c and d which come via CVS:
a-b----c'-d' <- e.g. remotes/cvs/cvshead
\ \
c-d-----e- <- e.g. masterI find that merge loops in the history like this make it hard to get the list of exports to commit next time.
i.e. After adding some more commits to master:
a-b----c'-d' <- remotes/cvs/cvshead
\ \
c-d-----e-f-g <- masterThen you want to commit f and g. But:
git rev-list master..remotes/cvs/cvshead
Will return c, d, e, f, g. So instead I typically add this to step 5:
git reset --hard remotes/cvs/cvshead
Which discards c, d and e, leaving:
a-b-c'-d' <- remotes/cvs/cvshead and master
Then you have a clean linear history and future commits to export. My script doesn't do this for you, currently, since in the case where there have been multiple branches merged in before commit e, you might prune away those branches as well as the duplicate commits on the working branch (i.e. c and d).
(I've just been avoiding this situation rather than fixing it, partly because I'd not found a better way yet, despite fiddling with various invocations of git-rebase. So I'd be particularly interested if anyone can suggest one.)
In theory c' and d' should be identical to c and d - although if you haven't set up an author map for git-cvsimport, you may find that your commits come back with the username you use in CVS, which may differ from that in git.
In this case, you need to have supplied the -A parameter to git-cvsimport in step 1.
Finally, whatever you use, you'll probably want the latest release of git, since it has a bug fix for git-cvsexportcommit. See:
http://article.gmane.org/gmane.comp.version-control.git/120241
Cheers,
N