git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: RFC: "negative" dirstat

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 19, 2011, 04:51 UTC
Message-ID
<7vtydu6dz2.fsf@alter.siamese.dyndns.org>
In-Reply-To
<BANLkTimEUSb9Na7Z+tnmytsqeeKLkQb9xA@mail.gmail.com>
Linus Torvalds <torvalds@linux-foundation.org> writes:
Show 17 quoted lines
> On Mon, Apr 18, 2011 at 2:33 PM, Junio C Hamano <gitster@pobox.com> wrote:
> ...
>> I guess what it boils down to is what you are trying to measure as the
>> "goodness" value of a change.
>
> Yes.
>
> Yes. If I see a lot of lines added in Documentation/, I really don't
> mind at all. And if I see a diffstat that says something like
>
>    1057 lines added, 2901 lines deleted
>
> I'm extremely happy. It's very different from one that would say
>
>    2958 lines added, 0 lines deleted
>
> even though --dirstat might consider the two equivalent right now.

I am afraid that this is ultimately "how to compare apples and oranges" (or "which is juicier, oranges or squirrels?") question.

If you are willing to say
    1000 lines added, 700 lines deleted

means "It changes 700 lines (removing the original 700 and replacing them with the new 700) and then adds 300 lines of new material", then you could simply use the max(added, p->one->size - copied) instead of using the sum of them as the damage count. Of course, depending on the nature of the change, the above interpretation does not apply in general.

Show 6 quoted lines
>> At least, if you count literal-added vs src-copied across the files
>> within the subarch, instead of doing it per-file, you would be able to
>> detect the "moving" part more accurately.
>
> Yes. However, "moving" is in many ways still not as interesting as
> "actually removed".  Moving, on it's own, is a pretty neutral operation.
I think I was unclear, but I was shooting for the same thing.

I meant "by doing the added/copied computation across all files, the real additions and deletions would reflect in the result without the noise from the 'moving' part."

Previous: Linus Torvalds
Message 4 of 4 in “RFC: "negative" dirstat”
  1. Linus TorvaldsApr 18, 2011
  2. Junio C HamanoApr 18, 2011
  3. Linus TorvaldsApr 18, 2011
  4. Junio C HamanoApr 19, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.