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

Re: [PATCH] has_sha1_file: re-check pack directory before giving up

From
Jeff King <peff@peff.net>
Date
Aug 30, 2013, 04:28 UTC
Message-ID
<20130830042801.GA23780@sigill.intra.peff.net>
In-Reply-To
<20130830011052.GA21895@sigill.intra.peff.net>
On Thu, Aug 29, 2013 at 09:10:52PM -0400, Jeff King wrote:
Show 5 quoted lines
> In the case of git-fsck, which uses the
> DO_FOR_EACH_INCLUDE_BROKEN flag, this will cause us to
> erroneously complain that the ref points to an invalid
> object. But for git-repack, which does not use that flag, we
> will skip the ref completely!

Hmm. This is slightly inaccurate. fsck does not use INCLUDE_BROKEN, and that is why it recognizes (and prints the warning) the "broken" ref. pack-objects would also print a warning, but would dutifully ignore the broken ref during the repack.

So it is actually something like for-each-ref, which _does_ use INCLUDE_BROKEN, that behaves differently. And it tends to work, because it ends up calling read_sha1_file to find out about the file rather than checking has_sha1_file.

-Peff
Previous: Jeff KingNext: Jeff King
Message 5 of 6 in “has_sha1_file: re-check pack directory before giving up”
  1. has_sha1_file: re-check pack directory before giving upJeff King, Aug 30, 2013
  2. Eric SunshineAug 30, 2013
  3. Junio C HamanoAug 30, 2013
  4. Jeff KingAug 30, 2013
  5. Jeff KingAug 30, 2013
  6. [PATCHv2] has_sha1_file: re-check pack directory before giving upJeff King, Aug 30, 2013

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.