Re: [PATCH] Fix cg-commit -p to not touch the working tree

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

 



Sam Vilain <sam@xxxxxxxxxx> writes:

> Junio C Hamano wrote:
>>> Previously, the working tree state was modified with `patch', which
>>> was a fragile operation.  Do everything with `git-apply --cached
>>> --index' instead.
>>>     
>> I do not use Cogito so I do not know what behaviour is wanted
>> here, but '--cached --index' is same as saying just '--cached'
>> as far as I know.  It will patch against the index and should
>> not touch working tree.  If the original used 'patch' to apply,
>> I suspect it wanted to touch the working tree (and possibly, it
>> wanted to leave the index alone?), so --cached might be
>> completely wrong thing to use here?
>>   
>
> The context is that "cg-commit -p", a kind of poor man's interactive
> commit that lets you preview changes that are to be committed in 'diff'
> form, and edit the patch to be applied. Many users expect this command
> to behave this way; they're quite surprised and sometimes even miffed
> when the changes they deleted from the patch are gone from their working
> copy.

Ah, I see that's why you do want to leave the working tree
untouched.  I think '--cached' alone is the right way to spell
it (strictly speaking, giving --index and --cached should error
out, although the current implementation does not).

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