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

Re: [PATCH] Hint at "checkout -p" in the "reset --patch <type>" error message

From
Jeff King <peff@peff.net>
Date
Nov 25, 2010, 16:14 UTC
Message-ID
<20101125161446.GA24426@sigill.intra.peff.net>
In-Reply-To
<vpqbp5diei5.fsf@bauges.imag.fr>
On Thu, Nov 25, 2010 at 04:56:02PM +0100, Matthieu Moy wrote:
Show 10 quoted lines
> > The man page for git-reset points at git-checkout already.
> >
> > Until we have a "verbosity level" config across all commands, I don't
> > favor adding a lot of hints to command error messages.
> 
> I agree for "regular output", but this case is an error message that
> users should never see. If you see the message, it means you tried a
> command that doesn't exist, and I can't imagine a case where this
> would be disturbing to get an informative message pointing to the
> right command.

I have to agree. When I introduced advice.*, I had initially intended to have "advice.all" or similar, so expert users could shut off the verbose warnings.

But I found that I didn't really want it. Most of the advice is for messages like these that you just don't see that often, and the extra line of output is simply not that big a deal. For messages that you _do_ see every day (e.g., the help in "git status"), it is not so cumbersome to set the proper config option.

Which isn't to say I would be against "advice.all" (or even advice.commandSuggestions) if somebody submitted a patch for it. I just don't want it personally.

And I don't think any of this needs to hold up Štěpán's patch[1]. What has happened in the past is something like:

  1. Somebody introduces new messages. The patch makes it into next.
  2. A developer gets annoyed and creates a patch for advice.whatever.
  3. That patch goes on the appropriate topic and they make it into the
     release together.

which makes sense to me. Then we know the patch in (2) is not just bikeshedding, but actually fixes somebody's annoyance. :)

-Peff

[1] Don't take this as an endorsement of the patch. I think the intent is good, but I haven't reviewed it carefully to make sure "git reset -p --mixed" actually works as advertised. Today is American Thanksgiving, so I probably won't get to it for a few days.

Previous: Matthieu Moy
Message 14 of 14 in “Git reset -p on working tree”
  1. Jeenu VNov 23, 2010
  2. knittlNov 23, 2010
  3. Jeenu VNov 23, 2010
  4. Jeenu VNov 23, 2010
  5. knittlNov 23, 2010
  6. Jeenu VNov 23, 2010
  7. Hint at "checkout -p" in the "reset --patch <type>" error messageŠtěpán Němec, Nov 23, 2010
  8. Jeff KingNov 23, 2010
  9. Štěpán NěmecNov 23, 2010
  10. Michael J GruberNov 25, 2010
  11. Jakub NarebskiNov 25, 2010
  12. Michael J GruberNov 25, 2010
  13. Matthieu MoyNov 25, 2010
  14. Jeff KingNov 25, 2010

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.