Re: [PATCHv2] git-mv: Keep moved index entries inact
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 21, 2008, 04:36 UTC
- Message-ID
- <7vd4l7yhsm.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <20080721002508.26773.92277.stgit@localhost>
Petr Baudis <pasky@suse.cz> writes:
Show 11 quoted lines
> This patch introduces rename_index_entry_at() into the index toolkit, > which will rename an entry while removing any entries the new entry > might render duplicate. This is then used in git mv instead > of all the file queues, resulting in a major simplification > of the code and an inevitable change in git mv -n output format. > > A new test has been added to the testsuite to reflect this change. > Also, based on suggestion by Junio about desired symlink behaviour > of git mv, I have added two tests for that; however, I do not have > need or desire to spend time fixing this, so they are expected > to fail for now until someone gets around to fixing that.
I haven't looked into the builtin-mv changes to see how involved that fix would be yet (and I do not use "mv" and this is somewhat lower priority for me myself), but I did look at changes to read-cache.c. I've queued a fixed up version in 'pu' for now but I am hoping that we can see some comments from more competent people on the patch and move the review result to 'next' shortly.
This may be a change in semantics, but after thinking about it a bit more, I think this can even go into maintenance series. IOW, it is really a fix. Nobody sane should have been relying on the old behaviour that new contents of dirty paths are staged in the index sometimes, which was simply just crazy.