git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: 6d4bb3833c3d2114d (fetch: verify we have everything we need before updating our ref) breaks fetch

From
Carlos Martín Nieto <cmn@elego.de>
Date
Sep 30, 2011, 23:48 UTC
Message-ID
<1317426491.4331.23.camel@centaur.lab.cmartin.tk>
In-Reply-To
<20110928185327.GB1482@sigill.intra.peff.net>
On Wed, 2011-09-28 at 14:53 -0400, Jeff King wrote:
Show 16 quoted lines
> On Wed, Sep 28, 2011 at 06:04:27PM +0200, Carlos Martín Nieto wrote:
> 
> > Whilst trying to do some work related to fetch, I came across a
> > regression in the 'next' branch. Bisecting gave me this commit as
> > breaking point (and I tried with the parent and there it worked). When
> > doing 'git fetch', rev-list will complain about usage, and fetch will
> > say that we didn't receive enough, even though earlier versions of git
> > have no problems. This fails both on github and on git.or.cz and for git
> > and http transports:
> > 
> > $ ./git-fetch git://repo.or.cz/git
> > usage: git rev-list [OPTION] <commit-id>... [ -- paths... ]
> 
> Hmm. I notice you're running a not-installed version of fetch. Might
> this be a problem with a new git fetch running an older, installed
> version of rev-list?
Yes, this seems indeed to be the case.
Show 25 quoted lines
> 
> The commit you mention calls rev-list with --verify-objects, but that
> feature is only added in the parent commit. So I can reproduce your
> issue with:
> 
>   $ git checkout 6d4bb38~2 ;# or anything before --verify-objects
>   $ make install
>   $ git checkout 6d4bb38
>   $ make
>   $ ./git-fetch git://repo.or.cz/git
> 
> but this works (because it sets the exec path properly):
> 
>   $ ./bin-wrappers/git fetch git://repo.or.cz/git
> 
> as does this:
> 
>   $ make install
>   $ ./git-fetch git://repo.or.cz/git
> 
> So I don't think there's a bug. It's just that running compiled programs
> straight out of the build directory isn't supported. It works _most_ of
> the time, but as you can see, you may end up calling older, installed
> versions of git. The bin-wrappers scripts set up the exec path properly
> to let you test.

Indeed, as both you and Junio pointed out (within three minutes of each other :) I was running git from the build directory and expected it to work, as I was testing a few changed I had made to the fetch code.

Mea culpa, I tend to forget that git tends to behave like a bunch of shell scripts that happen to be written in C. Thanks to both.

   cmn
Previous: Jeff KingNext: Jakub Narebski
Message 4 of 9 in “6d4bb3833c3d2114d (fetch: verify we have everything we need before updating our ref) breaks fetch”
  1. Carlos Martín NietoSep 28, 2011
  2. Junio C HamanoSep 28, 2011
  3. Jeff KingSep 28, 2011
  4. Carlos Martín NietoSep 30, 2011
  5. Jakub NarebskiSep 28, 2011
  6. Carlos Martín NietoSep 30, 2011
  7. Jeff KingOct 1, 2011
  8. Philip OakleyOct 1, 2011
  9. Jeff KingOct 1, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.