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

Re: [PATCH] fetch --prune: exit with error if pruning fails

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 28, 2022, 18:14 UTC
Message-ID
<xmqqpmobwwvg.fsf@gitster.g>
In-Reply-To
<nycvar.QRO.7.76.6.2201281110050.347@tvgsbejvaqbjf.bet>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 10 quoted lines
> I am not so sure. When pruning failed, there may very well be directories
> or files in the way of fetching the refs as desired. And it might be even
> worse if pruning failed _without_ the fetch failing afterwards: the user
> specifically asked for stale refs to be cleaned up, the command succeeded,
> but did not do what the user asked for.
>
> Maybe Thomas has an even stronger argument in favor of erroring out. In
> any case, I don't think that `--prune` should be a "best effort, otherwise
> just shrug" option. If we wanted that, we could introduce
> `--prune-best-effort` or some such...

I am not opposed to reporting an error by exiting with non-zero exit code. I never said it should be best effort, and doing the "fetch" part after a failed prune does not make it best effort.

What I am questioning is if it makes sense to stop the fetching part. When we fetch to update multiple refs, we do not stop at the first ref-update failure, but try to do as much as possible and then report an error, no? It is the same thing.

Previous: Johannes SchindelinNext: Thomas Gummerer
Message 6 of 11 in “fetch --prune: exit with error if pruning fails”
  1. fetch --prune: exit with error if pruning failsThomas Gummerer, Jan 27, 2022
  2. Junio C HamanoJan 27, 2022
  3. Johannes SchindelinJan 28, 2022
  4. Thomas GummererJan 28, 2022
  5. Johannes SchindelinJan 28, 2022
  6. Junio C HamanoJan 28, 2022
  7. Thomas GummererJan 28, 2022
  8. Johannes SchindelinJan 28, 2022
  9. Thomas GummererJan 31, 2022
  10. fetch --prune: exit with error if pruning failsThomas Gummerer, Jan 31, 2022
  11. Junio C HamanoJan 31, 2022

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.