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

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

 



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?

-Peff
--
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]