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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Junio,

On Thu, 27 Jan 2022, Junio C Hamano wrote:

> Thomas Gummerer <t.gummerer@xxxxxxxxx> 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.

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...

Ciao,
Dscho




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux