Re: git log --name-only improvement: show old file name in rename

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

 



Thanks all for your replies to this.  I hoped that --name-only could show when
a filename was removed, as well as when it was added.  If you delete a 
file in one commit then add it with a new name in the next, both 
filenames appear in the log.  If these happen in a single commit, only 
one does.  And in fact it's not predictable whether you will get one 
filename or two: it depends on rename detection.  Sometimes if a file is
changed and moved to a new name, git log --name-only will show only the
new name in the log, but at other times, if git doesn't detect it as a 
rename, both filenames appear.  This feels more like an implementation 
detail than a deliberate choice.

I accept that scripts may rely on the current behaviour, though I would 
be surprised to find a script that depended on *not* seeing the old 
filename printed.

Anyway, if it shouldn't change, or if it cannot change because of backwards compatibility, the manual page could be improved:

           --name-only
           Show only names of changed or added files.
           If a file is removed, its name is also printed, unless this is detected
           as a rename, in which case only the new name is printed.

That would be enough to direct users towards something more suitable like --compact-summary.




[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