Re: rm and mv commands: should I use them?

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

 



Jeff King <peff@xxxxxxxx> writes:

> I haven't looked to see if this optimization is in place, but "git mv"
> can also avoid having to recompute the sha1 of the file (which in most
> cases doesn't matter, but on a large file with a cold cache, can make
> the operation seem just as snappy as a regular "mv").

Actually, I think I found a bug.

	$ git reset --hard
	$ echo >>Makefile
        $ git diff --numstat
        1	0	Makefile
        $ git mv Makefile makefile
        $ git diff
        $ git diff --cached -M --numstat
        1	0	Makefile => makefile

"git mv" should not have staged the change.  It should have
moved the index entry from Makefile to makefile and moved the
work tree files.

The fix for this would fall out from your "optimization" quite
naturally, but I think that might be a post 1.5.4 item.


-
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