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

Re: [RFC/PATCH] fetch: bigger forced-update warnings

From
Thomas Rast <trast@student.ethz.ch>
Date
Sep 7, 2011, 22:42 UTC
Message-ID
<201109080042.45980.trast@student.ethz.ch>
In-Reply-To
<20110907212042.GG13364@sigill.intra.peff.net>
Jeff King wrote:
Show 5 quoted lines
> On Mon, Sep 05, 2011 at 02:14:57PM -0700, Shawn O. Pearce wrote:
> 
> > > Right. What I mean is, what should the bigger warning look like?
> > 
> > Its a bikeshed. I refuse to paint bikesheds. :-)
[...]
> +	if (uncommon_forced_update)
> +		warning("HEY STUPID FIX YOUR TOPICS");

Whatever comes out of the bikeshedding, I'm going to keep a patch locally that refreshes the mental picture of Shawn shouting that!

That being said, I think there should be a multiline warning pointing the user at the "recovering from upstream rebase" section in git-rebase(1). At least by default with an advice.* setting to disable it.

> +       if (!prefixcmp(message, "fetch: fast-forward"))
> +               uc->fastforward++;
> +       else if (!prefixcmp(message, "fetch: forced-update\n"))
> +               uc->forced++;

That doesn't work: fetch puts the whole command line there. E.g.

  git fetch altgit
  --> fetch altgit: fast-forward
  git fetch altgit next:refs/remotes/next
  --> fetch altgit next:remotes/altgit/next: fast-forward

There's also a minor subtlety here that I had to double-check first: the message for a branch creation is 'storing head', so the later check

> +       return uc.fastforward && uc.forced <= 1; /* 1 for the one we just did */
never triggers at the second fetch.
-- 
Thomas Rast
trast@{inf,student}.ethz.ch
Previous: Jeff KingNext: Matthieu Moy
Message 25 of 27 in “Dropping '+' from fetch = +refs/heads/*:refs/remotes/origin/*?”
  1. Junio C HamanoSep 1, 2011
  2. Junio C HamanoSep 1, 2011
  3. Shawn PearceSep 1, 2011
  4. Michael J GruberSep 1, 2011
  5. Matthieu MoySep 1, 2011
  6. Shawn PearceSep 1, 2011
  7. Matthieu MoySep 2, 2011
  8. Jeff KingSep 2, 2011
  9. Johannes SixtSep 2, 2011
  10. Jeff KingSep 2, 2011
  11. Michael J GruberSep 2, 2011
  12. Jeff KingSep 2, 2011
  13. Junio C HamanoSep 2, 2011
  14. Jeff KingSep 2, 2011
  15. Junio C HamanoSep 2, 2011
  16. Shawn PearceSep 5, 2011
  17. Jeff KingSep 5, 2011
  18. Shawn PearceSep 5, 2011
  19. Jeff KingSep 5, 2011
  20. Shawn PearceSep 5, 2011
  21. fetch: bigger forced-update warningsJeff King, Sep 7, 2011
  22. Shawn PearceSep 7, 2011
  23. Junio C HamanoSep 7, 2011
  24. Jeff KingSep 7, 2011
  25. Thomas RastSep 7, 2011
  26. Matthieu MoySep 6, 2011
  27. Michael J GruberSep 6, 2011

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.