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

Re: git receive-pack deletes refs one at a time?

From
Jeff King <peff@peff.net>
Date
Jun 13, 2019, 21:20 UTC
Message-ID
<20190613212005.GA1970@sigill.intra.peff.net>
In-Reply-To
<34FD9B2B-D53A-4CD2-AEF0-3AFAF1586EB7@codeaurora.org>
On Thu, Jun 13, 2019 at 01:46:05PM -0600, Nasser Grainawi wrote:
Show 13 quoted lines
> > The underlying ref code is smart enough to coalesce all of the deletions
> > in a single transaction into a single write of the packed-refs file.
> > 
> > But historically, pushes do not do a single ref transaction because we
> > would allow the push for one ref to succeed while others failed. Later,
> > we added an "atomic" mode that does it all in a single transaction.
> > 
> > Try with "git push --atomic", which should be able to do it in a single
> > write.
> 
> Thanks!
> 
> Is there a way to get the bulk behavior without the all-or-nothing behavior?

No, I don't think so. In theory the ref backend code could have a "non-atomic" flag that lets it do as much as possible of a single transaction. But nobody has ever implemented that.

In practice, using "--atomic" shouldn't cause failures, unless you are trying to delete refs that somebody else is modifying at the same time.

-Peff
Previous: Nasser Grainawi
Message 4 of 4 in “git receive-pack deletes refs one at a time?”
  1. Nasser GrainawiJun 13, 2019
  2. Jeff KingJun 13, 2019
  3. Nasser GrainawiJun 13, 2019
  4. Jeff KingJun 13, 2019

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.