Re: Proposed git mv behavioral change

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

 




On 18 Oct 2007, at 9:57:15 PM, Shawn O. Pearce wrote:

Michael Witten <mfwitten@xxxxxxx> wrote:
On 18 Oct 2007, at 11:47:32 AM, lmage11@xxxxxxxxxxxx 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.

No.  It wouldn't.  The index has no knowledge of history of anything.

I mean to say, if only the index is changed,
then git won't be informed about the necessary
git-{add/rm}'s, as in the following (is this
not so?):

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

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

  Powered by Linux