Re: Proposed git mv behavioral change
- From
Michael Witten <mfwitten@mit.edu>
- Date
- Oct 19, 2007, 01:47 UTC
- Message-ID
- <D2EAAC6D-567D-454A-AECA-C90FA2C369AE@mit.edu>
- In-Reply-To
- <c594999b2337.2337c594999b@nyroc.rr.com>
On 18 Oct 2007, at 11:47:32 AM, lmage11@twcny.rr.com wrote:
> I don't know exactly how git manages the index > internally, but a > shortcut for this would be to simply rename the index entry in place.
Seems like the shortcut would lose the history and confuse git.
Anyway,
Let's say you have a file, A.txt, with contents:
A
You edit this file so that it has contents: A_dirty
You're saying that, currently, 'git-mv A.txt path/B.txt' does this: mv A.txt path/B.txt git add path/B.txt git rm A.txt
So that A.txt is indeed moved to path/B.txt, but now A_dirty has been added to the index.
What you want to happen is the following: git show HEAD:A.txt > path/B.txt git add path/B.txt mv A.txt B.txt git rm A.txt
Is this correct?
Michael Witten