git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] reset: Better warning message on git reset --mixed <paths>
@ 2010-08-14 19:34 Ævar Arnfjörð Bjarmason
  2010-08-14 21:05 ` Jonathan Nieder
  0 siblings, 1 reply; 18+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2010-08-14 19:34 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ralf Ebert,
	Ævar Arnfjörð Bjarmason

When you call "git reset --mixed <paths>" git will complain that using
mixed with paths is deprecated:

    warning: --mixed option is deprecated with paths.

That doesn't tell the user why it's deprecated, or what he should use
instead. Expand on the warning and tell the user to just omit --mixed:

    warning: --mixed is redundant with paths, use 'git reset <paths>' instead.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---

On Sat, Aug 14, 2010 at 19:12, Ralf Ebert <info@ralfebert.de> wrote:
> On 14.08.2010 20:55, Ævar Arnfjörð Bjarmason wrote:
>>
>> On Sat, Aug 14, 2010 at 18:40, Ralf Ebert<info@ralfebert.de>  wrote:
>>>
>>> On 14.08.2010 17:23, Ævar Arnfjörð Bjarmason wrote:
>>>>
>>>> So what should I use instead? 0e5a7faa which introduced it doesn't say.
>>>
>>> It doesn't currently exist, but I'm pretty sure it should be called 'git
>>> unstage' :)
>>
>> Then perhaps it should be undeprecated? If what you say is correct
>> it's been whining about that since 2007 with no alternative, while
>> doing what I mean when I run it.
>
> Sorry, I misremembered '--mixed' again, '--mixed' is the default and it
> doesn't complain if you just omit it, and if I read&tried right, 'git reset
> <file>' does the same as 'git reset --mixed <file>'.

Right you are, if only we had a manpage to explain this or something >:)

Anyway, I think the warning could be better, here's a patch to
implement that. We could also warn on a plain "git reset --mixed"
since it's also redundant, but that would be adding something new so I
haven't done that here.

 builtin/reset.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/builtin/reset.c b/builtin/reset.c
index 1283068..a7878d4 100644
--- a/builtin/reset.c
+++ b/builtin/reset.c
@@ -318,7 +318,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
 	 * affecting the working tree nor HEAD. */
 	if (i < argc) {
 		if (reset_type == MIXED)
-			warning("--mixed option is deprecated with paths.");
+			warning("--mixed is redundant with paths, use 'git reset <paths>' instead.");
 		else if (reset_type != NONE)
 			die("Cannot do %s reset with paths.",
 					reset_type_names[reset_type]);
-- 
1.7.2.1.339.g9c5d4

^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2010-08-16  4:23 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-14 19:34 [PATCH] reset: Better warning message on git reset --mixed <paths> Ævar Arnfjörð Bjarmason
2010-08-14 21:05 ` Jonathan Nieder
2010-08-15  1:47   ` Junio C Hamano
2010-08-15  2:43     ` Miles Bader
2010-08-15  8:38       ` Ævar Arnfjörð Bjarmason
2010-08-15 18:36         ` Junio C Hamano
2010-08-15 19:49           ` Jonathan Nieder
2010-08-15 22:18             ` Junio C Hamano
2010-08-15 20:51           ` Ævar Arnfjörð Bjarmason
2010-08-15 22:22             ` Junio C Hamano
2010-08-16  0:59             ` Miles Bader
2010-08-16  1:13               ` Ævar Arnfjörð Bjarmason
2010-08-15 21:05           ` Ralf Ebert
2010-08-16  0:12             ` Jonathan Nieder
2010-08-15 13:02       ` David Fries
2010-08-15  8:43   ` [PATCH v2] " Ævar Arnfjörð Bjarmason
2010-08-16  3:39     ` Junio C Hamano
2010-08-16  4:23       ` Ævar Arnfjörð Bjarmason

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).