Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15

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

From: Jeff King <hidden>
Date: 2016-06-15 22:50:05

Possibly related (same subject, not in this thread)

On Tue, Nov 23, 2010 at 03:20:58PM +0100, Štěpán Němec wrote:
quoted hunk ↗ jump to hunk
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?

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help