Thread (29 messages) flat view 29 messages, 16 authors, 2016-08-14

Re: [PATCH] cmd_reset: don't trash uncommitted changes unless told to

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:44:49

Possibly related (same subject, not in this thread)

Steven Walter [off-list ref] writes:
quoted hunk ↗ jump to hunk
@@ -225,6 +243,10 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
 	if (reset_type == HARD && is_bare_repository())
 		die("hard reset makes no sense in a bare repository");
 
+        if (reset_type == HARD && !force && index_is_dirty()) {
+                die("Uncommitted changes; re-run with -f to trash them");
+        }
+
Please don't.  With your change, does the testsuite even pass?

"reset --hard" has *ALWAYS* meant to be destructive --- discarding
potential local cruft is the whole point of the operation.

Learn the lingo, and get over it.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help