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

Re: [PATCH] connected.c: reprepare packs for corner cases

From
Jeff King <peff@peff.net>
Date
Mar 13, 2020, 02:34 UTC
Message-ID
<20200313023427.GB900007@coredump.intra.peff.net>
In-Reply-To
<20200313023034.GA900007@coredump.intra.peff.net>
On Thu, Mar 12, 2020 at 10:30:34PM -0400, Jeff King wrote:
Show 7 quoted lines
> So that would actually argue that your patch is putting it in the right
> place. It's _not_ fetch's responsibility to reprepare_packed_git(). It's
> the loop in check_connected() that is skipping the usual reprepare
> logic, and shouldn't.
> 
> And one fix (which you did) is to just preemptively reprepare right
> above that loop. Some other solutions are:
I know I've now suggested that your patch is both wrong and right. :)
Just to be clear, at this point I think I'd be OK with either solution.

If it's going into check_connected(), the commit message should argue that the loop there is at fault for not doing the usual fallback, and a single explicit reprepare() is cheap enough to cover the case we care about (and that we don't have to worry about racing with somebody else repacking because the point of that flag is that we're in a brand new repo).

Repreparing earlier in the transport-helper code _could_ still protect against other similar loops, which is an argument for putting it there. But I'd be inclined to say those other loops should be corrected.

-Peff
Previous: Jeff KingNext: Derrick Stolee
Message 10 of 12 in “connected.c: reprepare packs for corner cases”
  1. connected.c: reprepare packs for corner casesDerrick Stolee via GitGitGadget, Mar 12, 2020
  2. Jonathan TanMar 12, 2020
  3. Derrick StoleeMar 12, 2020
  4. Junio C HamanoMar 12, 2020
  5. Jeff KingMar 12, 2020
  6. Jeff KingMar 12, 2020
  7. Derrick StoleeMar 13, 2020
  8. Junio C HamanoMar 13, 2020
  9. Jeff KingMar 13, 2020
  10. Jeff KingMar 13, 2020
  11. Derrick StoleeMar 13, 2020
  12. connected.c: reprepare packs for corner casesDerrick Stolee via GitGitGadget, Mar 13, 2020

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.