{"thread":{"id":"2192","subject":"git and gitweb inconsistencies","startedAt":"2005-10-23T00:14:12Z","lastAt":"2005-10-23T18:28:01Z","messageCount":4,"participants":["Chris Shoemaker","Sven Verdoolaege"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"10470","messageId":"20051023001412.GA22679@pe.Belkin","threadId":"2192","inReplyTo":null,"subject":"git and gitweb inconsistencies","fromName":"Chris Shoemaker","fromEmail":"c.shoemaker@cox.net","sentAt":"2005-10-23T00:14:12Z","receivedAt":"2005-10-23T00:14:12Z","isPatch":false,"sender":{"key":"c.shoemaker@cox.net","avatar":null},"body":"I've been experimenting with git and gitweb, but I've reached deadend.\nMaybe someone can help?\n\n\nShort Version:\n\nIn sub git_get_type in gitweb.cgi, this line:\n  open my $fd, \"-|\", \"$gitbin/git-cat-file -t $hash\" or return;\n\nresults in:\nerror: unable to find e71b869f3333ad10a492251e099ed9176248a420\nfatal: git-cat-file e71b869f3333ad10a492251e099ed9176248a420: bad file\n\nBUT, from the shell:\n$ git-cat-file -t e71b869f3333ad10a492251e099ed9176248a420\ncommit\n\n\nLonger explanation:\n\nInitially I created the git repository using git-cvsimport as\ndescribed in the cvs-migration document.  I also installed gitweb.cgi\nand everything seemed to be fine.  In particular the refs/heads/* files\nreferred to the tips of current branches in cvs.  I was quite pleased.\n\nA few days later, I ran git-cvsimport again, with -i.  This imported\njust the recent changes, but the view from gitweb didn't change.  :(\n\nAt first, I thought that the git-cvsimport hadn't worked.  But,\ngit-whatchanged clearly showed the new changes.  (I later learned that\ngit-rev-list also returned the tip-of-branch commits.)  After reading\ngitweb.cgi, I realized that the refs/heads/* files had not been\nchanged, so they still referred to the tip-of-branch for the initial\nimport.  (I expected the refs/heads/* to point to the last commit on\neach branch.  Was that wrong?)\n\nAnyway, I tried to make a new head that actually pointed to what I\nexpected: \n\n$ echo `git-rev-list tip --max-count=1` > refs/heads/mytest\n$ git-cat-file -t `cat refs/heads/mytest`\ncommit\n\nNo problem.  But, this same task doesn't seem to work from gitweb.cgi:\n\n$ ./gitweb.cgi http://localhost/cgi-bin/gitweb.cgi?p=test\\;a=heads > /dev/null\nerror: unable to find e71b869f3333ad10a492251e099ed9176248a420\nfatal: git-cat-file e71b869f3333ad10a492251e099ed9176248a420: bad file\n\nHow can this be?  Have I messed something up, or am I just totally confused?\n\n-chris\n\nps. please cc, not subscribed.\n"},{"id":"10482","messageId":"20051023115939.GG8383MdfPADPa@greensroom.kotnet.org","threadId":"2192","inReplyTo":"20051023001412.GA22679@pe.Belkin","subject":"Re: git and gitweb inconsistencies","fromName":"Sven Verdoolaege","fromEmail":"skimo@kotnet.org","sentAt":"2005-10-23T11:59:39Z","receivedAt":"2005-10-23T11:59:39Z","isPatch":false,"sender":{"key":"skimo@kotnet.org","avatar":null},"body":"On Sat, Oct 22, 2005 at 08:14:12PM -0400, Chris Shoemaker wrote:\n> A few days later, I ran git-cvsimport again, with -i.  This imported\n> just the recent changes, but the view from gitweb didn't change.  :(\n\nAre you sure you didn't just create a new import *inside* the old import ?\nDo you have, say, both an 'objects' and a '.git/objects' directory ?\n\n> $ echo `git-rev-list tip --max-count=1` > refs/heads/mytest\n> $ git-cat-file -t `cat refs/heads/mytest`\n\nThat should be\n\ngit-update-ref refs/heads/mytest tip\n(the new head will appear in .git/refs/heads/mytest, \nunless you've set GIT_DIR)\ngit-cat-file -t mytest\n\n\nskimo\n"},{"id":"10486","messageId":"20051023173055.GA3019@pe.Belkin","threadId":"2192","inReplyTo":"20051023115939.GG8383MdfPADPa@greensroom.kotnet.org","subject":"Re: git and gitweb inconsistencies","fromName":"Chris Shoemaker","fromEmail":"c.shoemaker@cox.net","sentAt":"2005-10-23T17:30:55Z","receivedAt":"2005-10-23T17:30:55Z","isPatch":false,"sender":{"key":"c.shoemaker@cox.net","avatar":null},"body":"On Sun, Oct 23, 2005 at 01:59:39PM +0200, Sven Verdoolaege wrote:\n> On Sat, Oct 22, 2005 at 08:14:12PM -0400, Chris Shoemaker wrote:\n> > A few days later, I ran git-cvsimport again, with -i.  This imported\n> > just the recent changes, but the view from gitweb didn't change.  :(\n> \n> Are you sure you didn't just create a new import *inside* the old import ?\n> Do you have, say, both an 'objects' and a '.git/objects' directory ?\n\nOH!  You, sir, DO have a crystal ball.  :) \n\nI foolishly assumed that the second time I ran git-cvsimport, with -C\n/pub/scm/project/ it would be able to detect that I was using the\nstand-alone GIT-DIR.  But, it obviously didn't.  I guess the solution\nis use specify GIT_DIR everytime I run git-cvstimport.\n\nSo, it seems that git-web.cgi detects and prefers the stand-alone\ndirectory structure, because I specify it in the projects_list file,\nwhile git-cat-file, and git-update-ref default to using .git.\n\n> \n> > $ echo `git-rev-list tip --max-count=1` > refs/heads/mytest\n> > $ git-cat-file -t `cat refs/heads/mytest`\n> \n> That should be\n> \n> git-update-ref refs/heads/mytest tip\n> (the new head will appear in .git/refs/heads/mytest, \n> unless you've set GIT_DIR)\n> git-cat-file -t mytest\n\nAh, and if I'd used that command, I would have realized something was\nwrong when mytest *didn't* appear in refs/heads, but rather\n.git/refs/heads.\n\nThanks for thinking creatively about how I could have messed it up!\n\n-chris\n\n> \n> \n> skimo\n"},{"id":"10487","messageId":"20051023182800.GH8383MdfPADPa@greensroom.kotnet.org","threadId":"2192","inReplyTo":"20051023173055.GA3019@pe.Belkin","subject":"Re: git and gitweb inconsistencies","fromName":"Sven Verdoolaege","fromEmail":"skimo@kotnet.org","sentAt":"2005-10-23T18:28:01Z","receivedAt":"2005-10-23T18:28:01Z","isPatch":false,"sender":{"key":"skimo@kotnet.org","avatar":null},"body":"On Sun, Oct 23, 2005 at 01:30:55PM -0400, Chris Shoemaker wrote:\n> I foolishly assumed that the second time I ran git-cvsimport, with -C\n> /pub/scm/project/ it would be able to detect that I was using the\n> stand-alone GIT-DIR.  But, it obviously didn't.  I guess the solution\n> is use specify GIT_DIR everytime I run git-cvstimport.\n\nSince many of the core git tools try to detect the actual git dir,\nit might not be a bad idea for cvsimport to do this as well.\nIt probably also shouldn't create a new git repository if the -i\noption has been specified.\n\n> So, it seems that git-web.cgi detects and prefers the stand-alone\n> directory structure, because I specify it in the projects_list file,\n> while git-cat-file, and git-update-ref default to using .git.\n\ngitweb just sets GIT_DIR and then the core git tools won't guess.\n\nskimo\n"}]}