Re: [PATCH] Hint at "checkout -p" in the "reset --patch <type>" error message
- From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
- Date
- Nov 25, 2010, 15:56 UTC
- Message-ID
- <vpqbp5diei5.fsf@bauges.imag.fr>
- In-Reply-To
- <4CEE2472.5020901@drmicha.warpmail.net>
Michael J Gruber <git@drmicha.warpmail.net> writes:
Show 13 quoted lines
>>>> if (patch_mode) {
>>>> if (reset_type != NONE)
>>>> - die("--patch is incompatible with --{hard,mixed,soft}");
>>>> + die("--patch is incompatible with --{hard,mixed,soft}\n"
>>>> + "(use \"git checkout -p\" to selectively discard changes in working directory)");
>>>> return interactive_reset(rev, argv + i, prefix);
>>>> }
>>>
>
> 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.
-- Matthieu Moy http://www-verimag.imag.fr/~moy/