How should files be moved in the glibc repository

Russ Allbery eagle@eyrie.org
Tue Nov 29 04:25:00 GMT 2016


Zack Weinberg <zackw@panix.com> writes:
> Steve Ellcey <sellcey@caviumnetworks.com> wrote:

>> I found my problem.  I was doing 'git diff' and not 'git diff HEAD'.
>> The 'git diff' command did not capture renames or deletes when creating
>> a patch, the 'git diff HEAD' command does capture them and then when I
>> apply that patch the old files are no longer there.

> Doing `git config --global diff.renames true` might sort this out.
> Also, for patch submission `git format-patch` is better.

I suspect the problem that Steve is having is that git mv implicitly does
a git add of the moved file, so the diff is in the index and therefore no
longer shows up in git diff by default (which shows only differences not
added to the index).  git diff --cached will show the rename.

You'll be able to see the difference in git status.  The renames will show
up in the portion of the output for changes that one has already used git
add on.

-- 
Russ Allbery (eagle@eyrie.org)              <http://www.eyrie.org/~eagle/>



More information about the Libc-alpha mailing list