git stash and manually edited chunks
- From
- Olivier Verdier <zelbier@gmail.com>
- Date
- Nov 1, 2010, 07:27 UTC
- Message-ID
- <AANLkTik6esqP2EkA6SFmfS0zdokG1iTKXqivA2wnpq=9@mail.gmail.com>
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:
* git add -p my_file * I edit a chunk *manually* (using e) * git stash --keep-index * git stash pop
Now the problem occurs: the file my_file is now considered as conflicted, and git has completely messed with my edited chunk, so I have to edit the file, remove the merge marks, and run git add my_file followed by git reset HEAD
I'm puzzled because this happens only when editing a chunk manually. I don't see how this should make any difference at all.
I'm using version 1.7.3.1 on Mac OS X.
Thanks!!