Re: git stash and manually edited chunks

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

 



Thank you,

but that does not explain why there is a conflict *only* when I edit
the chunk manually, does it?

Besides, some people tried to reproduce my problem on Linux and they
got no conflict after edited chunks.

So it seems that it could be a bug specific to Mac OS X.

== Olivier

On 1 November 2010 17:58, Matthieu Moy <Matthieu.Moy@xxxxxxxxxxxxxxx> wrote:
> Olivier Verdier <zelbier@xxxxxxxxx> writes:
>
>> Hi!
>> I asked a question on stackoverflow
>> (http://stackoverflow.com/questions/4058372/git-stash-and-edited-chunks)
>> and someone suggested it might be a bug...
>> For convenience, I reproduce the question here:
>>
>> ÂI occasionally have the following problem, which is reproduced by the
>> following sequence of commands:
>
> Let's say the state of your working tree here is A (and last commit is
> HEAD).
>
>> * git add -p my_file
>> * IÂedit a chunk *manually*Â(usingÂe)
>
> Here, the index contains a state which is neither in the working tree
> nor in the last commit. Let's call this state B.
>
>> * git stash --keep-index
>
> Here, the working tree takes state B.
>
>> * git stash pop
>
> Here, you're trying to apply the stash, which is somehow a diff
> between HEAD and A, on your tree which is in state B. Hence the
> conflicts.
>
>
> If you do a "git reset --hard" before the "git stash pop", you'll come
> back to state HEAD, and the stash will apply without conflict.
>
> --
> 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]