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

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

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jan 28, 2022, 12:36 UTC
Message-ID
<nycvar.QRO.7.76.6.2201281335050.347@tvgsbejvaqbjf.bet>
In-Reply-To
<87pmocp1si.fsf@coati.i-did-not-set--mail-host-address--so-tickle-me>
Hi Thomas & Junio,
On Fri, 28 Jan 2022, Thomas Gummerer wrote:
Show 32 quoted lines
> Johannes Schindelin writes:
>
> > On Thu, 27 Jan 2022, Junio C Hamano wrote:
> >
> >> Thomas Gummerer <t.gummerer@gmail.com> writes:
> >>
> >> > +		if (retcode) {
> >> > +			free_refs(ref_map);
> >> > +			goto cleanup;
> >> >  		}
> >>
> >> This part is iffy.  We tried to prune refs, we may have removed some
> >> of the refs missing from the other side but we may still have some
> >> other refs that are missing from the other side due to the failure
> >> we noticed.
> >>
> >> Is it sensible to abort the fetching?  I am undecided, but without
> >> further input, my gut reaction is that it is safe and may even be
> >> better to treat this as a soft error and try to go closer to where
> >> the user wanted to go as much as possible by continuing to fetch
> >> from the other side, given that we have already paid for the cost of
> >> discovering the refs from the other side.
>
> > 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.
>
> I was thinking along similar lines here.  I was going back and forth
> between letting the fetch continue, and then exiting with a non-zero
> exit code, and just erroring out directly.

Oh, I think I misunderstood Junio. As long as the failed prune will cause a non-zero exit code, I am fine with continuing to try to fetch.

Ciao, Dscho

Previous: Thomas GummererNext: Junio C Hamano
Message 5 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.