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

Re: [PATCH] pack-objects: turn off bitmaps when we see --shallow lines

From
Duy Nguyen <pclouds@gmail.com>
Date
Aug 12, 2014, 15:13 UTC
Message-ID
<CACsJy8AQ4vC4QKR_y62h_Gjd619QfBg-rDB2F6HFj2fvJj41tg@mail.gmail.com>
In-Reply-To
<20140812043452.GA11784@peff.net>
On Tue, Aug 12, 2014 at 11:34 AM, Jeff King <peff@peff.net> wrote:
Show 5 quoted lines
> Arguably is_repository_shallow should return 1 if anybody has registered
> a shallow graft, but that wouldn't be enough to fix this (we'd still
> need to check it again _after_ reading the --shallow lines). So I think
> this fix is fine here. I don't know if any other parts of the code would
> care, though.

It's getting too subtle (is_repository_shallow fails to return 1). register_shallow() is used elsewhere too, luckily pack bitmap's use is still limited in pack-objects (I think).I prefer (in future) to teach is_repository_shallow about register_shallow and move it to right before get_object_list_from_bitmap() is called, and some sort of mechanism to say "hey I'm all set, never change shallow repo status again from now on, or just die if you have to do it" to protect us from similar bugs. But for now your fix is good (and simple).

-- 
Duy
Previous: Jeff KingNext: Jeff King
Message 2 of 3 in “pack-objects: turn off bitmaps when we see --shallow lines”
  1. pack-objects: turn off bitmaps when we see --shallow linesJeff King, Aug 12, 2014
  2. Duy NguyenAug 12, 2014
  3. Jeff KingAug 13, 2014

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.