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

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
Previous: Christian CouderNext: Patrick Steinhardt
Message 12 of 27 in “fetch: improve atomicity of `--atomic` flag”
  1. 0/6 fetch: improve atomicity of `--atomic` flagPatrick Steinhardt, Feb 11, 2022
  2. 1/6 fetch: increase test coverage of fetchesPatrick Steinhardt, Feb 11, 2022
  3. Christian CouderFeb 15, 2022
  4. Patrick SteinhardtFeb 17, 2022
  5. 2/6 fetch: backfill tags before setting upstreamPatrick Steinhardt, Feb 11, 2022
  6. Christian CouderFeb 15, 2022
  7. 3/6 fetch: control lifecycle of FETCH_HEAD in a single placePatrick Steinhardt, Feb 11, 2022
  8. Christian CouderFeb 15, 2022
  9. Patrick SteinhardtFeb 17, 2022
  10. 4/6 fetch: report errors when backfilling tags failsPatrick Steinhardt, Feb 11, 2022
  11. Christian CouderFeb 15, 2022
  12. Patrick SteinhardtFeb 17, 2022
  13. Patrick SteinhardtFeb 17, 2022
  14. Jonathan TanFeb 16, 2022
  15. Elijah NewrenFeb 17, 2022
  16. 5/6 fetch: make `--atomic` flag cover backfilling of tagsPatrick Steinhardt, Feb 11, 2022
  17. Christian CouderFeb 15, 2022
  18. Jonathan TanFeb 16, 2022
  19. Patrick SteinhardtFeb 17, 2022
  20. Elijah NewrenFeb 17, 2022
  21. Patrick SteinhardtFeb 17, 2022
  22. 6/6 fetch: make `--atomic` flag cover pruning of refsPatrick Steinhardt, Feb 11, 2022
  23. Christian CouderFeb 15, 2022
  24. Patrick SteinhardtFeb 17, 2022
  25. Jonathan TanFeb 16, 2022
  26. Elijah NewrenFeb 17, 2022
  27. Patrick SteinhardtFeb 17, 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.