Hi,
I'm pretty new to GIT. I quickly convinced our project to move to GIT,
except for one guy that wants to do Windows and CVS :-( I setup a test
and the checkout works just fine, but commit from cvs doesn't work. The
details:
* Server: git version 1.5.3.1 compiled on SuSE 10.2, 64-bits
* Client, both SuSE CVS 1.12.12 and the current WinCVS cvs.exe,
so it appears irrelevant.
I created a test repository from a papers directory using the sequence
beloe. (P.s. isn't there a more elegant way to get to a bare shared repo
from a set of files? I tried (mkdir papers.git && cd papers.git && git
--bare init --shared=all), but I can't clone an empty bare repository
(doesn't create anything), so I can't add to it).
% cd ~/tmp/papers
% git-init
% git-add .
% git-commit
% cd /home/git
% git-clone --bare --no-hardlinks ~/tmp/papers/ papers.git
% cd papers.git
% git-config core.sharedrepository all
% chmod g+ws `find . -type d`
% chmod g+w `find . -type f`
Anyway, appears to work fine with GIT to clone, pull and push. Using
CVS over SSH, I can checkout this just fine, creating HEAD. Now I change
a file and run "cvs commit" to get:
gollem (2006) 11_> cvs commit -m "test"
cvs [commit aborted]: end of file from server (consult above messages if any)
I enabled logging and added a few statements to git-cvsserver (line 1203)
$log->info("Start git show-ref -s refs/heads/$state->{module}");
# Remember where the head was at the beginning.
my $parenthash = `git show-ref -s refs/heads/$state->{module}`;
$log->info("parenthash = $parenthash");
chomp $parenthash;
if ($parenthash !~ /^[0-9a-f]{40}$/) {
$log->warn("error 1 pserver cannot find the current HEAD of
module");
exit;
}
Then I get this log output:
================================================================
2007-10-03 12:25:16 : DEBUG - Temporary directory is '/tmp/XwYVFFqjyd'
2007-10-03 12:25:16 : DEBUG - req_Root : ...I start to get a clue. Adding a line $log->info("Heads: " . `git show-ref --heads`); I see this in the log: 2007-10-03 14:13:44 : INFO - Heads: 0b7b372d525a4fe7f662996fec9cd11b1038a6be refs/heads/master Thus, I though I created the repository the wrong way. Tried again, following the recipy of http://www.kernel.org/pub/software/scm/git/docs/cvs-migration.html: $ mkdir /pub/my-repo.git $ cd /pub/my-repo.git $ git --bare init --shared $ git --bare fetch /home/alice/myproject master:master Checked out freshly using CVS. No problem. But committing a change, nothing changed :-( The log output is exactly the same, showing only refs/heads/master. I'm starting to suspect git-cvsserver afterall, but the docs suggests it is operational for quite a while. Could someone give me a clue on what am I missed? -
More tests ... As it didn't like the HEAD, and insisted it only knows about master, I though what happens on cvs -d :ext:user@host:/git-repos.git co master <works fine> <edit> cvs commit ================================================================ 2007-10-03 16:43:37 : INFO - req_ci : [NULL] 2007-10-03 16:43:37 : INFO - Lockless commit start, basing commit on '/tmp/VP2P VNHPs0/6t4xncbMoN', index file is '/tmp/VP2PVNHPs0/SO4A6pzpau' 2007-10-03 16:43:37 : INFO - Start git show-ref -s refs/heads/master 2007-10-03 16:43:37 : INFO - Heads: 0b7b372d525a4fe7f662996fec9cd11b1038a6be re fs/heads/master 2007-10-03 16:43:37 : INFO - parenthash = 0b7b372d525a4fe7f662996fec9cd11b1038a 6be 2007-10-03 16:43:37 : INFO - Created index '/tmp/VP2PVNHPs0/SO4A6pzpau' with fo r head master - exit status 0 2007-10-03 16:43:37 : INFO - Committing collections-representation.txt 2007-10-03 16:43:37 : DEBUG - rename /tmp/VP2PVNHPs0/0SfbkMq6AN collections-repr esentation.txt 2007-10-03 16:43:37 : DEBUG - chmod u+rw-x collections-representation.txt 2007-10-03 16:43:37 : INFO - Updating file 'collections-representation.txt' 2007-10-03 16:43:37 : DEBUG - Treehash : aba0f583177b3b7fca05935452de22612164a7f 3, Parenthash : 0b7b372d525a4fe7f662996fec9cd11b1038a6be 2007-10-03 16:43:37 : INFO - Commit hash : 2007-10-03 16:43:37 : WARN - Commit failed (Invalid commit hash) ================================================================ !? What happens? Is git-cvsserver completely broken and should I thus forget about GIT for now (saying we cannot deal with cvs commit is politically unacceptable in this project)? Any clue? Please help --- Jan -
Hi, AFAIR we do not allow committing via pserver protocol. Might that be your problem? Ciao, Dscho -
Dscho, Thanks, but no. I'm using CVS over SSH. I've been looking around in git-cvsserver source a bit and it aborts quite quickly if you try a commit through pserver. I get a bit further, but it cannot find the HEAD revision for some reason and (from later message), if I try to checkout master instead of HEAD it finds the revision but I get a hash mismatch. I've tried a bit debugging this, but in 15 years CVS experience I never really needed to debug the protocol and my GIT experience is only 2 weeks old :-( My hope is I'm doing something fundamentally wrong and git-cvsserver just doesn't give a sensible error. I did setup the git repository using two different routes, one adviced in the CVS conversion manual. GIT operations work just fine, so does CVS checkout. I don't think you can to that much wrong with cvs over ssh clients, especially if checkout works just fine. Does anyone out there has a working GIT <-> CVS+SHH setup? Based on what version of GIT? Using what route to create the repository? Thanks --- Jan -
Hi, Okay, another stab: is your HEAD detached? Ciao, Dscho -
