All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael J Gruber <git@drmicha.warpmail.net>
To: "Štěpán Němec" <stepnem@gmail.com>
Cc: Jeff King <peff@peff.net>, Jeenu V <jeenuv@gmail.com>,
	knittl <knittl89@googlemail.com>,
	git@vger.kernel.org
Subject: Re: [PATCH] Hint at "checkout -p" in the "reset --patch <type>" error message
Date: Thu, 25 Nov 2010 09:55:14 +0100	[thread overview]
Message-ID: <4CEE2472.5020901@drmicha.warpmail.net> (raw)
In-Reply-To: <87ipzo83o9.fsf@gmail.com>

Štěpán Němec venit, vidit, dixit 23.11.2010 16:23:
> Jeff King <peff@peff.net> writes:
> 
>> On Tue, Nov 23, 2010 at 03:20:58PM +0100, Štěpán Němec wrote:
>>
>>> diff --git a/builtin/reset.c b/builtin/reset.c
>>> index 0037be4..fc530d2 100644
>>> --- a/builtin/reset.c
>>> +++ b/builtin/reset.c
>>> @@ -309,7 +309,8 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
>>>  
>>>  	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);
>>>  	}
>>
>> Should this actually print something different for --hard versus --mixed
>> versus --soft?
>>
>> For --soft, "-p" simply makes no sense as you are not changing the index
>> or the working directory.
>>
>> For --mixed, shouldn't we support "-p" already, as that is the default
>> mode?
>>
>> For --hard, suggesting "checkout -p" does make sense.
>>
>> Also, what about "--merge" and "--keep" modes?
> 
> All good questions, most of which occured to me, too. What I was going
> to do based on the outcome of (the discussion of) this patch was at
> least fix the currently out-of-date "--{hard,mixed,soft}", as the
> error is signalled with the newer options (--keep and --merge) as well.
> I'm not sure I could cope with anything much more complicated than that,
> esp. if it involved adding some new reset functionality. :-)

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.

Michael

  reply	other threads:[~2010-11-25  8:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-23  9:11 Git reset -p on working tree Jeenu V
2010-11-23  9:20 ` knittl
2010-11-23 10:26   ` Jeenu V
2010-11-23 10:32     ` Jeenu V
2010-11-23 10:58       ` knittl
2010-11-23 13:00         ` Jeenu V
2010-11-23 14:20           ` [PATCH] Hint at "checkout -p" in the "reset --patch <type>" error message Štěpán Němec
2010-11-23 14:59             ` Jeff King
2010-11-23 15:23               ` Štěpán Němec
2010-11-25  8:55                 ` Michael J Gruber [this message]
2010-11-25 10:56                   ` Jakub Narebski
2010-11-25 13:10                     ` Michael J Gruber
2010-11-25 15:56                   ` Matthieu Moy
2010-11-25 16:14                     ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4CEE2472.5020901@drmicha.warpmail.net \
    --to=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    --cc=jeenuv@gmail.com \
    --cc=knittl89@googlemail.com \
    --cc=peff@peff.net \
    --cc=stepnem@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.