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

Re: git repack -a -d is not safe

From
Shawn O. Pearce <spearce@spearce.org>
Date
Feb 1, 2007, 20:59 UTC
Message-ID
<20070201205934.GA19057@spearce.org>
In-Reply-To
<20070201112545.GA19855@moooo.ath.cx>
Matthias Lederhofer <matled@gmx.net> wrote:
Show 8 quoted lines
> First the object is unpacked, start something using read_sha1_file.
> read_sha1_file: try packed object (fails)
> run git repack -a -d
> read_sha1_file: try to read the loose object (fails)
> read_sha1_file: reread list of packs
> run git repack -a -d so it will create a new pack
> read_sha1_file: tries to open the old packs, not the new one, and
>                 fails

My 4 patch series that I just posted should (partially) fix this problem. We cannot close it completely however as there always exists the potential of the OS to starve the reader and allow 2 full repacks between the time the reader notices a .idx file and the time the reader could open the .pack.

At least now with my additional changes Git will report that a packfile is not usable, and then that the object cannot be found, and die.

All I can say is, wait at least a few minutes between repacks?  ;-)
-- 
Shawn.
Previous: Matthias LederhoferNext: Johannes Schindelin
Message 2 of 3 in “git repack -a -d is not safe”
  1. Matthias LederhoferFeb 1, 2007
  2. Shawn O. PearceFeb 1, 2007
  3. Johannes SchindelinFeb 1, 2007

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.