{"thread":{"id":"13257","subject":"Problem with git fetch over http://","startedAt":"2008-04-25T20:42:25Z","lastAt":"2008-04-25T23:35:45Z","messageCount":6,"participants":["John Wiegley","Junio C Hamano","Mike Hommey","Daniel Barkalow"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"75193","messageId":"63F7B390-32D1-458A-8ED9-D5AC62F46745@newartisans.com","threadId":"13257","inReplyTo":null,"subject":"Problem with git fetch over http://","fromName":"John Wiegley","fromEmail":"johnw@newartisans.com","sentAt":"2008-04-25T20:42:25Z","receivedAt":"2008-04-25T20:42:25Z","isPatch":false,"sender":{"key":"johnw@newartisans.com","avatar":null},"body":"Hello, I'm using the Builtbot to pull sources from a Git repository,  \nand have found that the Buildbot's Git step always uses git-fetch -- a  \ndetail of Buildbot which I currently have little control over.\n\nThis is no problem if the git:// protocol is used, but using fetch  \nwith http:// doesn't work.  This has been mentioned elsewhere:\n\n   http://lists.berlios.de/pipermail/bitbake-dev/2007-November/000765.html\n\nHere's a quick example of what I mean:\n\n   cd /tmp ; mkdir foo ; cd foo ; git init\n\n   git fetch git://newartisans.com/ledger.git\t# works fine\n\n   cd /tmp ; rm -fr foo ; mkdir foo ; cd foo ; git init\n\n   git fetch http://newartisans.com/git/ledger.git  # fails\n\nThis is happening with git-1.5.5 on the server, Apache 2.2 and  \ngit-1.5.5.1 on the client.\n\nThanks,\n   John\n"},{"id":"75194","messageId":"7v3ap9pr07.fsf@gitster.siamese.dyndns.org","threadId":"13257","inReplyTo":"63F7B390-32D1-458A-8ED9-D5AC62F46745@newartisans.com","subject":"Re: Problem with git fetch over http://","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-04-25T21:24:24Z","receivedAt":"2008-04-25T21:24:24Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"John Wiegley <johnw@newartisans.com> writes:\n\n> Hello, I'm using the Builtbot to pull sources from a Git repository,\n> and have found that the Buildbot's Git step always uses git-fetch -- a\n> detail of Buildbot which I currently have little control over.\n>\n> This is no problem if the git:// protocol is used, but using fetch\n> with http:// doesn't work.  This has been mentioned elsewhere:\n>\n>   http://lists.berlios.de/pipermail/bitbake-dev/2007-November/000765.html\n>\n> Here's a quick example of what I mean:\n>\n>   cd /tmp ; mkdir foo ; cd foo ; git init\n>\n>   git fetch git://newartisans.com/ledger.git\t# works fine\n>\n>   cd /tmp ; rm -fr foo ; mkdir foo ; cd foo ; git init\n>\n>   git fetch http://newartisans.com/git/ledger.git  # fails\n\nIs this related to this independent observation?\n\n$ wget http://newartisans.com/git/ledger.git\n--14:23:54--  http://newartisans.com/git/ledger.git\n           => `ledger.git'\nResolving newartisans.com... 208.70.150.153\nConnecting to newartisans.com|208.70.150.153|:80... connected.\nHTTP request sent, awaiting response... 301 Moved Permanently\nLocation: http://git.newartisans.com//ledger.git [following]\n--14:23:55--  http://git.newartisans.com//ledger.git\n           => `ledger.git'\nResolving git.newartisans.com... 208.70.150.153\nConnecting to git.newartisans.com|208.70.150.153|:80... connected.\nHTTP request sent, awaiting response... 301 Moved Permanently\nLocation: http://git.newartisans.com/ledger.git/ [following]\n--14:23:55--  http://git.newartisans.com/ledger.git/\n           => `index.html'\nConnecting to git.newartisans.com|208.70.150.153|:80... connected.\nHTTP request sent, awaiting response... 403 Forbidden\n14:23:55 ERROR 403: Forbidden.\n"},{"id":"75195","messageId":"20080425213411.GA25964@glandium.org","threadId":"13257","inReplyTo":"7v3ap9pr07.fsf@gitster.siamese.dyndns.org","subject":"Re: Problem with git fetch over http://","fromName":"Mike Hommey","fromEmail":"mh@glandium.org","sentAt":"2008-04-25T21:34:11Z","receivedAt":"2008-04-25T21:34:11Z","isPatch":false,"sender":{"key":"mh@glandium.org","avatar":"https://avatars.githubusercontent.com/u/1038527?v=4"},"body":"On Fri, Apr 25, 2008 at 02:24:24PM -0700, Junio C Hamano wrote:\n> John Wiegley <johnw@newartisans.com> writes:\n> \n> > Hello, I'm using the Builtbot to pull sources from a Git repository,\n> > and have found that the Buildbot's Git step always uses git-fetch -- a\n> > detail of Buildbot which I currently have little control over.\n> >\n> > This is no problem if the git:// protocol is used, but using fetch\n> > with http:// doesn't work.  This has been mentioned elsewhere:\n> >\n> >   http://lists.berlios.de/pipermail/bitbake-dev/2007-November/000765.html\n> >\n> > Here's a quick example of what I mean:\n> >\n> >   cd /tmp ; mkdir foo ; cd foo ; git init\n> >\n> >   git fetch git://newartisans.com/ledger.git\t# works fine\n> >\n> >   cd /tmp ; rm -fr foo ; mkdir foo ; cd foo ; git init\n> >\n> >   git fetch http://newartisans.com/git/ledger.git  # fails\n> \n> Is this related to this independent observation?\n> \n> $ wget http://newartisans.com/git/ledger.git\n> --14:23:54--  http://newartisans.com/git/ledger.git\n>            => `ledger.git'\n> Resolving newartisans.com... 208.70.150.153\n> Connecting to newartisans.com|208.70.150.153|:80... connected.\n> HTTP request sent, awaiting response... 301 Moved Permanently\n> Location: http://git.newartisans.com//ledger.git [following]\n> --14:23:55--  http://git.newartisans.com//ledger.git\n>            => `ledger.git'\n> Resolving git.newartisans.com... 208.70.150.153\n> Connecting to git.newartisans.com|208.70.150.153|:80... connected.\n> HTTP request sent, awaiting response... 301 Moved Permanently\n> Location: http://git.newartisans.com/ledger.git/ [following]\n> --14:23:55--  http://git.newartisans.com/ledger.git/\n>            => `index.html'\n> Connecting to git.newartisans.com|208.70.150.153|:80... connected.\n> HTTP request sent, awaiting response... 403 Forbidden\n> 14:23:55 ERROR 403: Forbidden.\n\nProbably, but even then, it also doesn't have a HEAD.\n\nMike\n"},{"id":"75196","messageId":"alpine.LNX.1.00.0804251749390.19665@iabervon.org","threadId":"13257","inReplyTo":"63F7B390-32D1-458A-8ED9-D5AC62F46745@newartisans.com","subject":"Re: Problem with git fetch over http://","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2008-04-25T22:04:16Z","receivedAt":"2008-04-25T22:04:16Z","isPatch":false,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Fri, 25 Apr 2008, John Wiegley wrote:\n\n> Hello, I'm using the Builtbot to pull sources from a Git repository, and have\n> found that the Buildbot's Git step always uses git-fetch -- a detail of\n> Buildbot which I currently have little control over.\n> \n> This is no problem if the git:// protocol is used, but using fetch with\n> http:// doesn't work.  This has been mentioned elsewhere:\n> \n>  http://lists.berlios.de/pipermail/bitbake-dev/2007-November/000765.html\n> \n> Here's a quick example of what I mean:\n> \n>  cd /tmp ; mkdir foo ; cd foo ; git init\n> \n>  git fetch git://newartisans.com/ledger.git\t# works fine\n> \n>  cd /tmp ; rm -fr foo ; mkdir foo ; cd foo ; git init\n> \n>  git fetch http://newartisans.com/git/ledger.git  # fails\n> \n> This is happening with git-1.5.5 on the server, Apache 2.2 and git-1.5.5.1 on\n> the client.\n\nJohn mentioned on IRC that clone works.\n\n$ git-ls-remote http://newartisans.com/git/ledger.git\n96751442d9eda537480867e599e4c604663f4530        refs/heads/master\n365baca5174232cc35e4ed190fd8ce93c3611c84        refs/heads/v2.4.1\nf972a89073843fdbb2a1bef969d9ca70509d4bfe        refs/heads/v2.5\n6a81d760dc4ab9028b27430124702c28c0b894ed        refs/tags/cvs-20040410\nfed3956a310a2ea8c8595b7fde7aaa0623492ca6        refs/tags/v0.1\n...\n\n$ git-ls-remote git://newartisans.com/ledger.git\n96751442d9eda537480867e599e4c604663f4530        HEAD\n96751442d9eda537480867e599e4c604663f4530        refs/heads/master\n365baca5174232cc35e4ed190fd8ce93c3611c84        refs/heads/v2.4.1\nf972a89073843fdbb2a1bef969d9ca70509d4bfe        refs/heads/v2.5\n6a81d760dc4ab9028b27430124702c28c0b894ed        refs/tags/cvs-20040410\nfed3956a310a2ea8c8595b7fde7aaa0623492ca6        refs/tags/v0.1\n...\n\nLooks like either server-info.c:update_info_refs() needs to also list \nHEAD, or transport.c:get_refs_via_curl() needs to guess that $url/HEAD \nexists and fetch it to add to the list, or both.\n\n\t-Daniel\n*This .sig left intentionally blank*\n"},{"id":"75197","messageId":"7vskx9o9ek.fsf@gitster.siamese.dyndns.org","threadId":"13257","inReplyTo":"alpine.LNX.1.00.0804251749390.19665@iabervon.org","subject":"Re: Problem with git fetch over http://","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-04-25T22:29:55Z","receivedAt":"2008-04-25T22:29:55Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Daniel Barkalow <barkalow@iabervon.org> writes:\n\n> John mentioned on IRC that clone works.\n>\n> $ git-ls-remote http://newartisans.com/git/ledger.git\n> 96751442d9eda537480867e599e4c604663f4530        refs/heads/master\n> 365baca5174232cc35e4ed190fd8ce93c3611c84        refs/heads/v2.4.1\n> f972a89073843fdbb2a1bef969d9ca70509d4bfe        refs/heads/v2.5\n> 6a81d760dc4ab9028b27430124702c28c0b894ed        refs/tags/cvs-20040410\n> fed3956a310a2ea8c8595b7fde7aaa0623492ca6        refs/tags/v0.1\n> ...\n>\n> $ git-ls-remote git://newartisans.com/ledger.git\n> 96751442d9eda537480867e599e4c604663f4530        HEAD\n> 96751442d9eda537480867e599e4c604663f4530        refs/heads/master\n> 365baca5174232cc35e4ed190fd8ce93c3611c84        refs/heads/v2.4.1\n> f972a89073843fdbb2a1bef969d9ca70509d4bfe        refs/heads/v2.5\n> 6a81d760dc4ab9028b27430124702c28c0b894ed        refs/tags/cvs-20040410\n> fed3956a310a2ea8c8595b7fde7aaa0623492ca6        refs/tags/v0.1\n> ...\n>\n> Looks like either server-info.c:update_info_refs() needs to also list \n> HEAD, or transport.c:get_refs_via_curl() needs to guess that $url/HEAD \n> exists and fetch it to add to the list, or both.\n\nWait a minute.  How did \"git fetch http://host/repo.git\" work before C\nrewrite?\n\nThe reason I ask is because info/refs traditionally did not list HEAD and\nfetch either would have failed to start walking from HEAD (iow, the issue\nwas very old), or it didn't care (iow, the issue is a regression after C\nrewrite).\n"},{"id":"75198","messageId":"alpine.LNX.1.00.0804251842510.19665@iabervon.org","threadId":"13257","inReplyTo":"7vskx9o9ek.fsf@gitster.siamese.dyndns.org","subject":"Re: Problem with git fetch over http://","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2008-04-25T23:35:45Z","receivedAt":"2008-04-25T23:35:45Z","isPatch":false,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Fri, 25 Apr 2008, Junio C Hamano wrote:\n\n> Daniel Barkalow <barkalow@iabervon.org> writes:\n> \n> > John mentioned on IRC that clone works.\n> >\n> > $ git-ls-remote http://newartisans.com/git/ledger.git\n> > 96751442d9eda537480867e599e4c604663f4530        refs/heads/master\n> > 365baca5174232cc35e4ed190fd8ce93c3611c84        refs/heads/v2.4.1\n> > f972a89073843fdbb2a1bef969d9ca70509d4bfe        refs/heads/v2.5\n> > 6a81d760dc4ab9028b27430124702c28c0b894ed        refs/tags/cvs-20040410\n> > fed3956a310a2ea8c8595b7fde7aaa0623492ca6        refs/tags/v0.1\n> > ...\n> >\n> > $ git-ls-remote git://newartisans.com/ledger.git\n> > 96751442d9eda537480867e599e4c604663f4530        HEAD\n> > 96751442d9eda537480867e599e4c604663f4530        refs/heads/master\n> > 365baca5174232cc35e4ed190fd8ce93c3611c84        refs/heads/v2.4.1\n> > f972a89073843fdbb2a1bef969d9ca70509d4bfe        refs/heads/v2.5\n> > 6a81d760dc4ab9028b27430124702c28c0b894ed        refs/tags/cvs-20040410\n> > fed3956a310a2ea8c8595b7fde7aaa0623492ca6        refs/tags/v0.1\n> > ...\n> >\n> > Looks like either server-info.c:update_info_refs() needs to also list \n> > HEAD, or transport.c:get_refs_via_curl() needs to guess that $url/HEAD \n> > exists and fetch it to add to the list, or both.\n> \n> Wait a minute.  How did \"git fetch http://host/repo.git\" work before C\n> rewrite?\n> \n> The reason I ask is because info/refs traditionally did not list HEAD and\n> fetch either would have failed to start walking from HEAD (iow, the issue\n> was very old), or it didn't care (iow, the issue is a regression after C\n> rewrite).\n\nI never managed to trace through the shell fetch code, but I suspect that \nit broke quite a long time ago (git-ls-remote.sh didn't list HEAD for \nhttp:// URLs, anyway). clone works because it uses entirely different \ncode, and \"git fetch origin\" (when origin is an http URL) works, and \"git \nfetch http://... branch\" works (and is a workaround), and that's probably \nall that people use regularly. This only comes up because there's an \nautomated fetch-and-build system that uses \"<vcs> command <location>\" to \nupdate, and it needed an actual quirk, rather than people just training \ntheir fingers to do things that work.\n\n\t-Daniel\n*This .sig left intentionally blank*\n"}]}