From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Jon Hancock <redstarling@gmail.com>,
git@vger.kernel.org
Subject: Re: rm and mv commands: should I use them?
Date: Sun, 06 Jan 2008 18:05:16 -0800 [thread overview]
Message-ID: <7v63y62xwj.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <20080107015518.GD17748@coredump.intra.peff.net> (Jeff King's message of "Sun, 6 Jan 2008 20:55:19 -0500")
Jeff King <peff@peff.net> 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.
next prev parent reply other threads:[~2008-01-07 2:05 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-06 7:55 rm and mv commands: should I use them? Jon Hancock
2008-01-06 8:04 ` David Brown
2008-01-06 8:08 ` Brian Swetland
2008-01-06 8:08 ` Jeff King
2008-01-06 19:22 ` Linus Torvalds
2008-01-07 1:55 ` Jeff King
2008-01-07 2:05 ` Junio C Hamano [this message]
2008-01-07 3:06 ` Jeff King
2008-01-07 18:37 ` Robin Rosenberg
2008-01-07 3:05 ` Jay Soffian
2008-01-07 5:01 ` David Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7v63y62xwj.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
--cc=redstarling@gmail.com \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).