Re: [PATCH] Add support for -p/--patch to git-commit

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

 



Conrad Irwin <conrad.irwin@xxxxxxxxx> writes:

> Hello Git,
>
> Please let me know of any mistakes I've made, this is a first for
> me.

At least one mistake:

To: unlisted-recipients:; (no To-header on input)

(I guess you've Bcc-ed the Git list, please don't do that)

> While this patch works as advertised, I wonder if it would be nicer to
> change the behaviour of git commit --interactive and git commit -p to
> act on a temporary copy of the index rather than mutating the existing
> index. I've no idea how to go about that yet, but is it something that
> should be changed?

I don't think so. After a commit, I usually expect the index to be
clean, ready to start preparing the next commit (except if I
explicitely asked the opposite), which implies that the index used for
commit (-i|-p) is the same as the usual one.

> +5. by using the --interactive or --patch switches with the 'commit' command
> +   to decide one by one which files or hunks should be part of the commit,
> +   before finalizing the operation.  Currently, this is done by invoking
> +   'git add --interactive'.

... or git add --patch.

> -	if (!!also + !!only + !!all + !!interactive > 1)
> -		die("Only one of --include/--only/--all/--interactive can be used.");
> +	if (!!also + !!only + !!all + !!interactive + !!patch_interactive > 1)
> +		die("Only one of --include/--only/--all/--interactive/--patch can be used.");

If I read correctly, this forbids "git commit --interactive --patch",
while "git add --interactive --patch" is allowed, and equivalent to
"--patch" alone.

Other than that, the patch looks good.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
--
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]