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

Re: Order of operations at the end of fast-import?

From
Mike Hommey <mh@glandium.org>
Date
Apr 16, 2020, 11:34 UTC
Message-ID
<20200416113404.pr2hzihavdvtfjh3@glandium.org>
In-Reply-To
<20200416042449.ztgyrdunsrzt7avp@glandium.org>
On Thu, Apr 16, 2020 at 01:24:49PM +0900, Mike Hommey wrote:
Show 14 quoted lines
> Hi,
> 
> I just noticed that the order of operations at the end of fast-import
> are:
> - end_packfile
> - dump_branches
> - dump_tags
> 
> The first may create loose objects if the pack is small (per
> fastimport.unpackLimit, defaulting to 100). The latter two create refs.
> 
> There seems to be a theoretical race condition here, if something else
> triggers a gc at the "wrong" time, the loose objects might be cleaned up
> and the branches/tags refs become dangling.

Come to think of it, this is only a problem with --prune=now, and the same applies to loose objects created with git add, git write-tree, git-commit-tree.

Mike
Previous: Jeff King
Message 5 of 5 in “Order of operations at the end of fast-import?”
  1. Mike HommeyApr 16, 2020
  2. Jeff KingApr 16, 2020
  3. Johannes SixtApr 16, 2020
  4. Jeff KingApr 16, 2020
  5. Mike HommeyApr 16, 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.