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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Steven Walter <stevenrwalter@xxxxxxxxx> writes:

> @@ -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.


--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux