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

[RFC/PATCH 0/4] make helpful messages optional

From
Jeff King <peff@peff.net>
Date
Sep 6, 2009, 06:44 UTC
Message-ID
<20090906064454.GA1643@coredump.intra.peff.net>
In-Reply-To
<20090811120313.6117@nanako3.lavabit.com>
On Tue, Aug 11, 2009 at 12:03:13PM +0900, Nanako Shiraishi wrote:
Show 6 quoted lines
>  		error("failed to push some refs to '%s'", url[i]);
> +		if (nonfastforward) {
> +			printf("To prevent you from losing history, non-fast-forward updates were rejected.\n"
> +			       "Merge the remote changes before pushing again.\n"
> +			       "See 'non-fast forward' section of 'git push --help' for details.\n");
> +		}

I saw this message in regular use for the first time today, and I thought it was terribly ugly. The sheer number of lines, coupled with the extremely ragged right edge made it much harder to pick out the nicely formatted status table. And of course the information in the message was totally worthless to me, as an experienced git user.

So rather than re-open the debate on whether this message should exist or not, here is a patch series which tries to address the issue:

  [1/4]: push: fix english in non-fast-forward message
    Hopefully non-controversial.
  [2/4]: push: re-flow non-fast-forward message
    This makes it prettier, IMHO.  I suspect the message was flowed as
    it was originally on purpose so that each sentence began on its own
    line. I think making it easier on the eyes is more important,
    though.
  [3/4]: push: make non-fast-forward help message configurable
    I feel like we have had this exact sort of tension before: we want
    one thing to help new users and experienced users want another
    thing. We have resisted an "expert user" config variable in the past
    because proposals usually involved a change of behavior, which could
    lead to quite confusing results. However, I think the case of
    "helpful messages" is much simpler. The message is meant purely for
    human consumption and is redundant with information already given,
    so an expert sitting at a novice's terminal (or vice versa) will not
    encounter any surprises.
    This actually introduces infrastructure for other, similar messages,
    so that we can make existing ones optional, or build new ones as
    appropriate.
  [4/4]: status: make "how to stage" messages optional
    This uses the infrastructure in 3/4 to lose the "use git add to add
    untracked files" advice.

I think (1) and (2) are pretty straightforward. (3) and (4) are more questionable, and I am undecided whether I am over-reacting to being annoyed by the message. I do know this is not the first time I have had the urge to write such a patch, so maybe others feel the same.

-Peff
Previous: Nanako ShiraishiNext: Jeff King
Message 22 of 48 in “push: point to 'git pull' and 'git push --force' in case of non-fast forward”
  1. push: point to 'git pull' and 'git push --force' in case of non-fast forwardMatthieu Moy, Aug 6, 2009
  2. Michael J GruberAug 6, 2009
  3. Matthieu MoyAug 7, 2009
  4. Michael J GruberAug 7, 2009
  5. Junio C HamanoAug 6, 2009
  6. Re: push: point to 'git pull' and 'git push --force' in case of non-fast forwardNicolas Sebrecht, Aug 6, 2009
  7. Junio C HamanoAug 6, 2009
  8. Matthieu MoyAug 7, 2009
  9. Junio C HamanoAug 7, 2009
  10. Matthieu MoyAug 7, 2009
  11. push: point to 'git pull' and 'git push --force' in case of non-fast forwardMatthieu Moy, Aug 8, 2009
  12. Teemu LikonenAug 8, 2009
  13. Matthieu MoyAug 8, 2009
  14. Junio C HamanoAug 8, 2009
  15. Re: push: point to 'git pull' and 'git push --force' in case of non-fast forwardNicolas Sebrecht, Aug 8, 2009
  16. Matthieu MoyAug 9, 2009
  17. Junio C HamanoAug 9, 2009
  18. Matthieu MoyAug 10, 2009
  19. Junio C HamanoAug 10, 2009
  20. Matthieu MoyAug 10, 2009
  21. Nanako ShiraishiAug 11, 2009
  22. 0/4 make helpful messages optionalJeff King, Sep 6, 2009
  23. 1/4 push: fix english in non-fast-forward messageJeff King, Sep 6, 2009
  24. 2/4 push: re-flow non-fast-forward messageJeff King, Sep 6, 2009
  25. 3/4 push: make non-fast-forward help message configurableJeff King, Sep 6, 2009
  26. Junio C HamanoSep 6, 2009
  27. Jeff KingSep 6, 2009
  28. Junio C HamanoSep 6, 2009
  29. Jeff KingSep 6, 2009
  30. Junio C HamanoSep 6, 2009
  31. Sverre RabbelierSep 6, 2009
  32. Nanako ShiraishiSep 7, 2009
  33. Johannes SixtSep 7, 2009
  34. Mike HommeySep 7, 2009
  35. Jeff KingSep 7, 2009
  36. Matthieu MoySep 7, 2009
  37. Jeff KingSep 7, 2009
  38. Matthieu MoySep 7, 2009
  39. Uri OkrentSep 8, 2009
  40. Jeff KingSep 9, 2009
  41. 0/2 configurable advice messagesJeff King, Sep 9, 2009
  42. 1/2 push: make non-fast-forward help message configurableJeff King, Sep 9, 2009
  43. Junio C HamanoSep 9, 2009
  44. Jeff KingSep 9, 2009
  45. Junio C HamanoSep 9, 2009
  46. 2/2 status: make "how to stage" messages optionalJeff King, Sep 9, 2009
  47. 4/4 status: make "how to stage" messages optionalJeff King, Sep 6, 2009
  48. Matthieu MoySep 6, 2009

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.