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

Re: [RFC] git-fetch - repack in the background after fetching

From
Linus Torvalds <torvalds@osdl.org>
Date
Jun 25, 2006, 03:53 UTC
Message-ID
<Pine.LNX.4.64.0606242049500.3747@g5.osdl.org>
In-Reply-To
<11511486003924-git-send-email-martin@catalyst.net.nz>
On Sat, 24 Jun 2006, Martin Langhoff wrote:
>
> Check whether we have a large set of unpacked objects and repack
> after the fetch, but don't for the user to wait for us. Conditional
> on core.autorepack =! no.
I don't think this is safe.
It's also done stupidly.

Instead of askign how many unpacked objects we have with the (expensive) git-rev-list, why not just do

	ls "$GIT_DIR/objects/00" | wc -l
which is pretty much guaranteed to be faster and easier.

However, the more worrisome thing about background repacking is that while it should be safe against normal users, if you have two _repacks_ at the same time, they can decide to remove each others packs. Yeah, yeah, that's pretty damn unlikely, but hey, "pretty damn unlikely" is not "impossible".

Also, I think you'd want to repack with "-l", in case the thing is set up with an alternate object directory.

			Linus
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 5 of 7 in “[RFC] git-fetch - repack in the background after fetching”
  1. Martin LanghoffJun 24, 2006
  2. Junio C HamanoJun 25, 2006
  3. Repack should try to prevent itself from running twice, concurrently.Ryan Anderson, Jun 25, 2006
  4. Johannes SchindelinJun 25, 2006
  5. Linus TorvaldsJun 25, 2006
  6. Johannes SchindelinJun 25, 2006
  7. Linus TorvaldsJun 25, 2006

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.