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

Re: [PATCH 1/2] diff --stat: use asymptotic scaling in graph

From
Aapodtele <apodtele@gmail.com>
Date
Oct 13, 2006, 13:56 UTC
Message-ID
<d620685f0610130656u55079a1fkc2c98a82f3aa4a33@mail.gmail.com>
In-Reply-To
<7vlknlmc9y.fsf@assigned-by-dhcp.cox.net>
On 10/12/06, Junio C Hamano <junkio@cox.net> wrote:
Show 17 quoted lines
> apodtele <apodtele@gmail.com> writes:
> > Instead of conditionally scaling the stat graph for large changes,
> > always scale it asymptotically: small changes shall appear without any
> > distortions.
> I am not sure if any non-linear scaling is worth pursuing.
> Suppose your change set has three files modified:
>
>         A       adds 20 lines, deletes 10 lines
>         B       adds 10 lines, deletes 20 lines
>         C       adds 30 lines, deletes 30 lines
>
> For obvious reasons, the total length of A and B exceeds half of
> C, which looks quite misleading.
>
>          A | ++++++++++++--------
>          B | ++++++++------------
>          C | +++++++++++++++---------------

Before my patch is completely forgotten, let me critique the current approach. Currently everything is great and beautiful unless one particular change adds a couple of hundred lines, say, to a man page. With large changes in play, small changes are squashed to a single character. Would you argue that this scenario correctly represent importance of man pages? Would you say, that it's not misleading that 1-, 2-, and 5-liners all look the same as long as a man page is prominently shown? Moreover, 1-, 2-, and 5- liners may look different depending on the size of that man page. The current approach is not invariant; it is, however, normalized as needed. "Normalized" is good, "as needed" is bad.

With asymptotic scaling, 1-, 2-, and 5- liners are correctly represented by a correct number of characters, regardless of the size of that man page. 10- and 20- liners are _slightly_ distorted. I cannot stress it more: the representation will not depend on the size of changes in other files! You will be able to tell where truly large changes happened too! The price for this is that you won't be able to precisely compare the sizes of added man pages.

It is your choice...
Previous: Junio C HamanoNext: Junio C Hamano
Message 15 of 16 in “diff --stat: use asymptotic scaling in graph”
  1. 1/2 diff --stat: use asymptotic scaling in graphapodtele, Oct 12, 2006
  2. Martin WaitzOct 12, 2006
  3. apodteleOct 12, 2006
  4. A Large Angry SCMOct 12, 2006
  5. Martin WaitzOct 12, 2006
  6. A Large Angry SCMOct 12, 2006
  7. Johannes SchindelinOct 12, 2006
  8. apodteleOct 12, 2006
  9. Nicolas PitreOct 13, 2006
  10. apodteleOct 13, 2006
  11. Andy WhitcroftOct 13, 2006
  12. Junio C HamanoOct 12, 2006
  13. A Large Angry SCMOct 12, 2006
  14. Junio C HamanoOct 12, 2006
  15. apodteleOct 13, 2006
  16. Junio C HamanoOct 14, 2006

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.