Re: [PATCH 4/6] fetch: report errors when backfilling tags fails
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Feb 17, 2022, 11:27 UTC
- Message-ID
- <Yg4xEQmXyzSeYZ1k@ncase>
- In-Reply-To
- <CAP8UFD0MQCpFfWg2FP3S1VpDAxCwp3WGucFPn7K9BZ7UnckNLw@mail.gmail.com>
On Tue, Feb 15, 2022 at 08:52:14AM +0100, Christian Couder wrote:
Show 7 quoted lines
> On Fri, Feb 11, 2022 at 9:03 PM Patrick Steinhardt <ps@pks.im> wrote: > > > > When the backfilling of tags fails we do not report this error to the > > caller, but only report it implicitly at a later point when reporting > > updated references. > > Probably stupid question: are we sure that it's a bug and not a feature?
Good question, and I don't have a definitive answer for it. But to me it very much smells like a bug: if I ask for a fetch and the fetch fails to populate some of the data I have asked for, then I want to get a notification on that failure.
Show 11 quoted lines
> > This leaves callers unable to act upon the > > information of whether the backfilling succeeded or not. > > > > Refactor the function to return an error code and pass it up the > > callstack. This causes us to correctly propagate the error back to the > > user of git-fetch(1). > > Even if it would have been the right behavior when backfilling tags > was implemented to return an error when backfilling tags fails, I > think it's interesting to ask ourselves if this change could be seen > as a regression by some users.
Yeah, it's not all that clear-cut because auto-following of tags is a bit obscure. But our default behaviour is to fetch tags pointing into the history, and if a user didn't want that they should've passed `--no-tags` to git-fetch(1). So conversely, we should assume that a user is asking for auto-filling of tags if we're not told otherwise, which also means that it is a failure if this fails.
At least that's my take, but I'm happy to hear arguments against my viewpoint.
Patrick