Re: [PATCH 4/3] --dirstat: In case of renames, use target filename instead of source filename
- From
Linus Torvalds <torvalds@linux-foundation.org>
- Date
- Apr 12, 2011, 14:59 UTC
- Message-ID
- <BANLkTinHcDug0A+n9N4hkApF_xBU+nEkBw@mail.gmail.com>
- In-Reply-To
- <201104121124.35128.johan@herland.net>
On Tue, Apr 12, 2011 at 2:24 AM, Johan Herland <johan@herland.net> wrote:
> This changes --dirstat analysis to count "damage" toward the target filename, > rather than the source filename. For renames within a directory, this won't > matter to the final output, but when moving files between diretories, the > output now lists the target directory rather than the source directory.
Ack. I think the use of the source filename was actually a bug.
The original dirstat code used the "struct diffstat_file_t *" pointer, and took the name from the ->name field of that. And that actually defaults to the target name (see diffstat_add()). But then commit c04a7155a03e changed it to use "struct dirstat_file" and picked the name for that from the source.
Linus