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

Re: Why is "git fetch --prune" so much slower than "git remote prune"?

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 19, 2015, 19:24 UTC
Message-ID
<xmqqpp84iye2.fsf@gitster.dls.corp.google.com>
In-Reply-To
<550AE1E4.7020407@alum.mit.edu>
Michael Haggerty <mhagger@alum.mit.edu> writes:
Show 12 quoted lines
>> Now that we have ref_transaction_*, I think if git-fetch fed all of the
>> deletes (along with the updates) into a single transaction, we would get
>> the same optimization for free. Maybe that is even part of some of the
>> pending ref_transaction work from Stefan or Michael (both cc'd). I
>> haven't kept up very well with what is cooking in pu.
>
> I am looking into this now.
>
> For pruning, we can't use a ref_transaction as it is currently
> implemented because it would fail if any of the reference deletions
> failed. But in this case I think if any deletions fail, we would prefer
> to emit a warning but keep going.

I am not quite sure what you mean here. I agree with you if you meant "we shouldn't fail the fetch only because 'fetch --prune' failed to remove only one of the remote-tracking refs that are no longer there" but that can easily be solved by the pruning phase into a separate transaction. If you meant "we would rather remove origin/{a,b} non-atomically when we noticed that origin/{a,b,c} are all gone than leaving all three intact only because we failed to remove origin/c for whatever reason", my knee-jerk reaction is "does it make practical difference to the end user between these two?"

What are the plausible cause of failing to prune unused remote-tracking refs?

Previous: Jeff KingNext: Jeff King
Message 5 of 8 in “Why is "git fetch --prune" so much slower than "git remote prune"?”
  1. Ævar Arnfjörð BjarmasonMar 6, 2015
  2. Jeff KingMar 6, 2015
  3. Michael HaggertyMar 19, 2015
  4. Jeff KingMar 19, 2015
  5. Junio C HamanoMar 19, 2015
  6. Jeff KingMar 19, 2015
  7. Michael HaggertyMar 20, 2015
  8. Junio C HamanoMar 20, 2015

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.