{"thread":{"id":"5905","subject":"[PATCH 1/2] diff --stat: use asymptotic scaling in graph","startedAt":"2006-10-12T19:37:17Z","lastAt":"2006-10-14T19:06:01Z","messageCount":16,"participants":["apodtele","Martin Waitz","Junio C Hamano","A Large Angry SCM","Johannes Schindelin","Nicolas Pitre","Andy Whitcroft"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"28676","messageId":"d620685f0610121237k458665c5m7bbde2d565d7ef81@mail.gmail.com","threadId":"5905","inReplyTo":null,"subject":"[PATCH 1/2] diff --stat: use asymptotic scaling in graph","fromName":"apodtele","fromEmail":"apodtele@gmail.com","sentAt":"2006-10-12T19:37:17Z","receivedAt":"2006-10-12T19:37:17Z","isPatch":true,"sender":{"key":"apodtele@gmail.com","avatar":null},"body":"Instead of conditionally scaling the stat graph for large changes,\nalways scale it asymptotically: small changes shall appear without any\ndistortions.\n\nSigned-off-by: Alexei Podtelezhnikov\n\n--- diff.c\t2006-10-12 14:45:13.000000000 -0400\n+++ diff.c\t2006-10-12 15:07:30.000000000 -0400\n@@ -637,15 +637,9 @@\n\n const char mime_boundary_leader[] = \"------------\";\n\n-static int scale_linear(int it, int width, int max_change)\n+static int scale_nonlinear(int it, int width)\n {\n-\t/*\n-\t * make sure that at least one '-' is printed if there were deletions,\n-\t * and likewise for '+'.\n-\t */\n-\tif (max_change < 2)\n-\t\treturn it;\n-\treturn ((it - 1) * (width - 1) + max_change - 1) / (max_change - 1);\n+\treturn it * width / (it + width) + 1;\n }\n\n static void show_name(const char *prefix, const char *name, int len,\n@@ -776,11 +770,9 @@\n \t\tadds += add;\n \t\tdels += del;\n\n-\t\tif (width <= max_change) {\n-\t\t\tadd = scale_linear(add, width, max_change);\n-\t\t\tdel = scale_linear(del, width, max_change);\n-\t\t\ttotal = add + del;\n-\t\t}\n+\t\tadd = scale_nonlinear(add, width / 2);\n+\t\tdel = scale_nonlinear(del, width / 2);\n+\t\ttotal = add + del;\n \t\tshow_name(prefix, name, len, reset, set);\n \t\tprintf(\"%5d \", added + deleted);\n \t\tshow_graph('+', add, add_c, reset);\n"},{"id":"28681","messageId":"20061012201646.GC10922@admingilde.org","threadId":"5905","inReplyTo":"d620685f0610121237k458665c5m7bbde2d565d7ef81@mail.gmail.com","subject":"Re: [PATCH 1/2] diff --stat: use asymptotic scaling in graph","fromName":"Martin Waitz","fromEmail":"tali@admingilde.org","sentAt":"2006-10-12T20:16:46Z","receivedAt":"2006-10-12T20:16:46Z","isPatch":true,"sender":{"key":"tali@admingilde.org","avatar":"https://gravatar.com/avatar/3f89b03eee362187effabe257898735b475673a12265c398ea9161259ae91553?d=mp&s=160"},"body":"hoi :)\n\nOn Thu, Oct 12, 2006 at 03:37:17PM -0400, apodtele wrote:\n> Instead of conditionally scaling the stat graph for large changes,\n> always scale it asymptotically: small changes shall appear without any\n> distortions.\n\nvery nice idea!\n\n> +\treturn it * width / (it + width) + 1;\n\nbut wouldn't this formula result in at least 1, even for a 0 change?\nPerhaps we'd have to special case an input of 0?\n\n-- \nMartin Waitz\n"},{"id":"28689","messageId":"d620685f0610121437m38eb454g7597b2a93010b023@mail.gmail.com","threadId":"5905","inReplyTo":"20061012201646.GC10922@admingilde.org","subject":"Re: [PATCH 1/2] diff --stat: use asymptotic scaling in graph","fromName":"apodtele","fromEmail":"apodtele@gmail.com","sentAt":"2006-10-12T21:37:14Z","receivedAt":"2006-10-12T21:37:14Z","isPatch":true,"sender":{"key":"apodtele@gmail.com","avatar":null},"body":"On 10/12/06, Martin Waitz <tali@admingilde.org> wrote:\n> On Thu, Oct 12, 2006 at 03:37:17PM -0400, apodtele wrote:\n> > Instead of conditionally scaling the stat graph for large changes,\n> > always scale it asymptotically: small changes shall appear without any\n> > distortions.\n>\n> very nice idea!\n>\n> > +     return it * width / (it + width) + 1;\n>\n> but wouldn't this formula result in at least 1, even for a 0 change?\n> Perhaps we'd have to special case an input of 0?\n\nCorrected patch follows.\n\n--- diff.c\t2006-10-12 14:45:13.000000000 -0400\n+++ diff.c\t2006-10-12 17:32:15.000000000 -0400\n@@ -637,15 +637,12 @@\n\n const char mime_boundary_leader[] = \"------------\";\n\n-static int scale_linear(int it, int width, int max_change)\n+static int scale_nonlinear(int it, int width)\n {\n-\t/*\n-\t * make sure that at least one '-' is printed if there were deletions,\n-\t * and likewise for '+'.\n-\t */\n-\tif (max_change < 2)\n-\t\treturn it;\n-\treturn ((it - 1) * (width - 1) + max_change - 1) / (max_change - 1);\n+\tif (it)\n+\t\treturn it * width / (it + width) + 1;\n+\telse\n+\t\treturn 0;\n }\n\n static void show_name(const char *prefix, const char *name, int len,\n@@ -776,11 +773,9 @@\n \t\tadds += add;\n \t\tdels += del;\n\n-\t\tif (width <= max_change) {\n-\t\t\tadd = scale_linear(add, width, max_change);\n-\t\t\tdel = scale_linear(del, width, max_change);\n-\t\t\ttotal = add + del;\n-\t\t}\n+\t\tadd = scale_nonlinear(add, width / 2);\n+\t\tdel = scale_nonlinear(del, width / 2);\n+\t\ttotal = add + del;\n \t\tshow_name(prefix, name, len, reset, set);\n \t\tprintf(\"%5d \", added + deleted);\n \t\tshow_graph('+', add, add_c, reset);\n"},{"id":"28688","messageId":"7vlknlmc9y.fsf@assigned-by-dhcp.cox.net","threadId":"5905","inReplyTo":"d620685f0610121237k458665c5m7bbde2d565d7ef81@mail.gmail.com","subject":"Re: [PATCH 1/2] diff --stat: use asymptotic scaling in graph","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-10-12T21:53:29Z","receivedAt":"2006-10-12T21:53:29Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"apodtele <apodtele@gmail.com> writes:\n\n> Instead of conditionally scaling the stat graph for large changes,\n> always scale it asymptotically: small changes shall appear without any\n> distortions.\n>\n> Signed-off-by: Alexei Podtelezhnikov\n\nMissing e-mail address on S-o-b line.  If your mail From: line\ndoes not say who you are, please add an extra From: line in the\nbody, like this:\n\n\tFrom: Alexei Podtelezhnikov <apodtele@gmail.com>\n        Subject: [PATCH 1/2] diff --stat: ...\n\n        Instead of ...\n\n\tSigned-off-by: Alexei Podtelezhnikov <apodtele@gmail.com>\n\n\nI am not sure if any non-linear scaling is worth pursuing.\nSuppose your change set has three files modified:\n\n\tA\tadds 20 lines, deletes 10 lines\n        B\tadds 10 lines, deletes 20 lines\n        C\tadds 30 lines, deletes 30 lines\n\nWhen drawing into a specified width that leaves 20-column for\nthe graph part, what would we see?  What would we see if the\ngraph part is 21-column wide?  59-column wide?  80-column wide?\n\nFor obvious reasons, the total length of A and B exceeds half of\nC, which looks quite misleading.\n\n         A | ++++++++++++--------\n         B | ++++++++------------\n         C | +++++++++++++++---------------\n\nWe could align things in the middle, like this, though:\n\n         A |    ++++++++++++--------\n         B |        ++++++++------------\n         C | +++++++++++++++---------------\n"},{"id":"28692","messageId":"452EBE6E.6040802@gmail.com","threadId":"5905","inReplyTo":"7vlknlmc9y.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH 1/2] diff --stat: use asymptotic scaling in graph","fromName":"A Large Angry SCM","fromEmail":"gitzilla@gmail.com","sentAt":"2006-10-12T22:15:10Z","receivedAt":"2006-10-12T22:15:10Z","isPatch":true,"sender":{"key":"gitzilla@gmail.com","avatar":"https://gravatar.com/avatar/354625c442439908ff3dd99757dee330e29e9df7847472384faf7a00add247fb?d=mp&s=160"},"body":"Junio C Hamano wrote:\n[...]\n >\n > We could align things in the middle, like this, though:\n >\n >          A |    ++++++++++++--------\n >          B |        ++++++++------------\n >          C | +++++++++++++++---------------\n\nThis is more diff like and makes comparing the right and left side \nchanges easier.\n\n          A |        --------@++++++++++++    |\n          B |    ------------@++++++++        |\n          C | ---------------@+++++++++++++++ |\n"},{"id":"28691","messageId":"452EBF99.5020108@gmail.com","threadId":"5905","inReplyTo":"d620685f0610121437m38eb454g7597b2a93010b023@mail.gmail.com","subject":"Re: [PATCH 1/2] diff --stat: use asymptotic scaling in graph","fromName":"A Large Angry SCM","fromEmail":"gitzilla@gmail.com","sentAt":"2006-10-12T22:20:09Z","receivedAt":"2006-10-12T22:20:09Z","isPatch":true,"sender":{"key":"gitzilla@gmail.com","avatar":"https://gravatar.com/avatar/354625c442439908ff3dd99757dee330e29e9df7847472384faf7a00add247fb?d=mp&s=160"},"body":"apodtele wrote:\n> On 10/12/06, Martin Waitz <tali@admingilde.org> wrote:\n>> On Thu, Oct 12, 2006 at 03:37:17PM -0400, apodtele wrote:\n>> > Instead of conditionally scaling the stat graph for large changes,\n>> > always scale it asymptotically: small changes shall appear without any\n>> > distortions.\n>>\n>> very nice idea!\n>>\n>> > +     return it * width / (it + width) + 1;\n>>\n>> but wouldn't this formula result in at least 1, even for a 0 change?\n>> Perhaps we'd have to special case an input of 0?\n[...]\n> +    if (it)\n> +        return it * width / (it + width) + 1;\n> +    else\n> +        return 0;\n\nNo conditional needed:\n\n\treturn it * width / (it + width - 1)\n"},{"id":"28695","messageId":"7viripkwag.fsf@assigned-by-dhcp.cox.net","threadId":"5905","inReplyTo":"7vlknlmc9y.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH 1/2] diff --stat: use asymptotic scaling in graph","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-10-12T22:24:07Z","receivedAt":"2006-10-12T22:24:07Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <junkio@cox.net> writes:\n\n> Missing e-mail address on S-o-b line.  If your mail From: line\n> does not say who you are, please add an extra From: line in the\n> body, like this:\n>\n> \tFrom: Alexei Podtelezhnikov <apodtele@gmail.com>\n>         Subject: [PATCH 1/2] diff --stat: ...\n>\n>         Instead of ...\n>\n> \tSigned-off-by: Alexei Podtelezhnikov <apodtele@gmail.com>\n\nEh, no.\n\nSorry, what I meant was:\n\nNot like this:\n\n        From: apodtele <apodtele@gmail.com>\n        Subject: [PATCH 1/2] diff --stat: ...\n\n        Instead of ...\n\n        Signed-off-by: Alexei Podtelezhnikov\n\nBut like this:\n\n        From: apodtele <apodtele@gmail.com>\n        Subject: [PATCH 1/2] diff --stat: ...\n\n        From: Alexei Podtelezhnikov <apodtele@gmail.com>\n\n        Instead of ...\n\n        Signed-off-by: Alexei Podtelezhnikov <apodtele@gmail.com>\n"},{"id":"28697","messageId":"20061012222703.GA31152@admingilde.org","threadId":"5905","inReplyTo":"452EBF99.5020108@gmail.com","subject":"Re: [PATCH 1/2] diff --stat: use asymptotic scaling in graph","fromName":"Martin Waitz","fromEmail":"tali@admingilde.org","sentAt":"2006-10-12T22:27:03Z","receivedAt":"2006-10-12T22:27:03Z","isPatch":true,"sender":{"key":"tali@admingilde.org","avatar":"https://gravatar.com/avatar/3f89b03eee362187effabe257898735b475673a12265c398ea9161259ae91553?d=mp&s=160"},"body":"hoi :)\n\nOn Thu, Oct 12, 2006 at 03:20:09PM -0700, A Large Angry SCM wrote:\n> >+    if (it)\n> >+        return it * width / (it + width) + 1;\n> >+    else\n> >+        return 0;\n> \n> No conditional needed:\n> \n> \treturn it * width / (it + width - 1)\n\nBut then it would start scaling much earlier\n(for width 10: at 2 instead of 4).\nThis is not bad per se, but different...\n\n-- \nMartin Waitz\n"},{"id":"28699","messageId":"452EC625.7050301@gmail.com","threadId":"5905","inReplyTo":"20061012222703.GA31152@admingilde.org","subject":"Re: [PATCH 1/2] diff --stat: use asymptotic scaling in graph","fromName":"A Large Angry SCM","fromEmail":"gitzilla@gmail.com","sentAt":"2006-10-12T22:48:05Z","receivedAt":"2006-10-12T22:48:05Z","isPatch":true,"sender":{"key":"gitzilla@gmail.com","avatar":"https://gravatar.com/avatar/354625c442439908ff3dd99757dee330e29e9df7847472384faf7a00add247fb?d=mp&s=160"},"body":"Martin Waitz wrote:\n> On Thu, Oct 12, 2006 at 03:20:09PM -0700, A Large Angry SCM wrote:\n>>> +    if (it)\n>>> +        return it * width / (it + width) + 1;\n>>> +    else\n>>> +        return 0;\n>> No conditional needed:\n>>\n>> \treturn it * width / (it + width - 1)\n> \n> But then it would start scaling much earlier\n> (for width 10: at 2 instead of 4).\n> This is not bad per se, but different...\n> \n\nOK:\n\treturn (it * width + (it + width)/2)) / (it + width - 1)\n\nNow it's back at 4. ;-)\n"},{"id":"28701","messageId":"Pine.LNX.4.63.0610130051440.14200@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"5905","inReplyTo":"452EC625.7050301@gmail.com","subject":"Re: [PATCH 1/2] diff --stat: use asymptotic scaling in graph","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-10-12T22:52:12Z","receivedAt":"2006-10-12T22:52:12Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 12 Oct 2006, A Large Angry SCM wrote:\n\n> Martin Waitz wrote:\n> > On Thu, Oct 12, 2006 at 03:20:09PM -0700, A Large Angry SCM wrote:\n> > > > +    if (it)\n> > > > +        return it * width / (it + width) + 1;\n> > > > +    else\n> > > > +        return 0;\n> > > No conditional needed:\n> > > \n> > > \treturn it * width / (it + width - 1)\n> > \n> > But then it would start scaling much earlier\n> > (for width 10: at 2 instead of 4).\n> > This is not bad per se, but different...\n> > \n> \n> OK:\n> \treturn (it * width + (it + width)/2)) / (it + width - 1)\n> \n> Now it's back at 4. ;-)\n\nAm I the only one finding non-linear diffstat ugly and misleading?\n\nCiao,\nDscho\n"},{"id":"28702","messageId":"d620685f0610121612y62f335e5pc5930354edb8cd67@mail.gmail.com","threadId":"5905","inReplyTo":"Pine.LNX.4.63.0610130051440.14200@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH 1/2] diff --stat: use asymptotic scaling in graph","fromName":"apodtele","fromEmail":"apodtele@gmail.com","sentAt":"2006-10-12T23:12:24Z","receivedAt":"2006-10-12T23:12:24Z","isPatch":true,"sender":{"key":"apodtele@gmail.com","avatar":null},"body":"On 10/12/06, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> Am I the only one finding non-linear diffstat ugly and misleading?\n\nWell, the scaling I propose _is_  linear for small changes. More\nimportantly, the existing scheme is not linear across the diffs\neither. Different stats may _look_ the same but be very different in\nsize in the existing scheme already. My proposal is invariant across\ndiff stats. Junio's argument that a change of 30 doesn't look like a\nhalf of 60 is valid, of course. Does anyone really checks this with a\nruler?\n"},{"id":"28708","messageId":"Pine.LNX.4.64.0610122038330.2435@xanadu.home","threadId":"5905","inReplyTo":"452EC625.7050301@gmail.com","subject":"Re: [PATCH 1/2] diff --stat: use asymptotic scaling in graph","fromName":"Nicolas Pitre","fromEmail":"nico@cam.org","sentAt":"2006-10-13T00:39:30Z","receivedAt":"2006-10-13T00:39:30Z","isPatch":true,"sender":{"key":"nico@fluxnic.net","avatar":"https://avatars.githubusercontent.com/u/702790?v=4"},"body":"On Thu, 12 Oct 2006, A Large Angry SCM wrote:\n\n> Martin Waitz wrote:\n> > On Thu, Oct 12, 2006 at 03:20:09PM -0700, A Large Angry SCM wrote:\n> > > > +    if (it)\n> > > > +        return it * width / (it + width) + 1;\n> > > > +    else\n> > > > +        return 0;\n> > > No conditional needed:\n> > >\n> > >  return it * width / (it + width - 1)\n> > \n> > But then it would start scaling much earlier\n> > (for width 10: at 2 instead of 4).\n> > This is not bad per se, but different...\n> > \n> \n> OK:\n> \treturn (it * width + (it + width)/2)) / (it + width - 1)\n> \n> Now it's back at 4. ;-)\n\nSure, but at this point the original conditional is probably more \nefficient.\n\n\nNicolas\n"},{"id":"28728","messageId":"d620685f0610130625o2d5f70c5p7cb41f567093df32@mail.gmail.com","threadId":"5905","inReplyTo":"Pine.LNX.4.64.0610122038330.2435@xanadu.home","subject":"Re: [PATCH 1/2] diff --stat: use asymptotic scaling in graph","fromName":"apodtele","fromEmail":"apodtele@gmail.com","sentAt":"2006-10-13T13:25:09Z","receivedAt":"2006-10-13T13:25:09Z","isPatch":true,"sender":{"key":"apodtele@gmail.com","avatar":null},"body":"Hi!\n\nOn 10/12/06, Nicolas Pitre <nico@cam.org> wrote:\n> On Thu, 12 Oct 2006, A Large Angry SCM wrote:\n> > Martin Waitz wrote:\n> > > On Thu, Oct 12, 2006 at 03:20:09PM -0700, A Large Angry SCM wrote:\n> > > > > +    if (it)\n> > > > > +        return it * width / (it + width) + 1;\n> > > > > +    else\n> > > > > +        return 0;\n> > > > No conditional needed:\n> > > >\n> > > >  return it * width / (it + width - 1)\n> > >\n> > > But then it would start scaling much earlier\n> > > (for width 10: at 2 instead of 4).\n> > > This is not bad per se, but different...\n> > >\n> >\n> > OK:\n> >       return (it * width + (it + width)/2)) / (it + width - 1)\n> >\n> > Now it's back at 4. ;-)\n>\n> Sure, but at this point the original conditional is probably more\n> efficient.\n>\n\nDon't make me use\n            return it * width / (it + width) + !!it;\n"},{"id":"28729","messageId":"452F9534.1030109@shadowen.org","threadId":"5905","inReplyTo":"d620685f0610130625o2d5f70c5p7cb41f567093df32@mail.gmail.com","subject":"Re: [PATCH 1/2] diff --stat: use asymptotic scaling in graph","fromName":"Andy Whitcroft","fromEmail":"apw@shadowen.org","sentAt":"2006-10-13T13:31:32Z","receivedAt":"2006-10-13T13:31:32Z","isPatch":true,"sender":{"key":"apw@shadowen.org","avatar":"https://gravatar.com/avatar/d3088262854661a913ef35cc40fedcc270142d4461791142bc1ea0b2a4e2e147?d=mp&s=160"},"body":"apodtele wrote:\n> Hi!\n> \n> On 10/12/06, Nicolas Pitre <nico@cam.org> wrote:\n>> On Thu, 12 Oct 2006, A Large Angry SCM wrote:\n>> > Martin Waitz wrote:\n>> > > On Thu, Oct 12, 2006 at 03:20:09PM -0700, A Large Angry SCM wrote:\n>> > > > > +    if (it)\n>> > > > > +        return it * width / (it + width) + 1;\n>> > > > > +    else\n>> > > > > +        return 0;\n>> > > > No conditional needed:\n>> > > >\n>> > > >  return it * width / (it + width - 1)\n>> > >\n>> > > But then it would start scaling much earlier\n>> > > (for width 10: at 2 instead of 4).\n>> > > This is not bad per se, but different...\n>> > >\n>> >\n>> > OK:\n>> >       return (it * width + (it + width)/2)) / (it + width - 1)\n>> >\n>> > Now it's back at 4. ;-)\n>>\n>> Sure, but at this point the original conditional is probably more\n>> efficient.\n>>\n> \n> Don't make me use\n>            return it * width / (it + width) + !!it;\n> -\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n\n\nreturn it * width / (it + width) + (it != 0)\n\nPerhaps?\n\n-apw\n"},{"id":"28731","messageId":"d620685f0610130656u55079a1fkc2c98a82f3aa4a33@mail.gmail.com","threadId":"5905","inReplyTo":"7vlknlmc9y.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH 1/2] diff --stat: use asymptotic scaling in graph","fromName":"apodtele","fromEmail":"apodtele@gmail.com","sentAt":"2006-10-13T13:56:58Z","receivedAt":"2006-10-13T13:56:58Z","isPatch":true,"sender":{"key":"apodtele@gmail.com","avatar":null},"body":"On 10/12/06, Junio C Hamano <junkio@cox.net> wrote:\n> apodtele <apodtele@gmail.com> writes:\n> > Instead of conditionally scaling the stat graph for large changes,\n> > always scale it asymptotically: small changes shall appear without any\n> > distortions.\n> I am not sure if any non-linear scaling is worth pursuing.\n> Suppose your change set has three files modified:\n>\n>         A       adds 20 lines, deletes 10 lines\n>         B       adds 10 lines, deletes 20 lines\n>         C       adds 30 lines, deletes 30 lines\n>\n> For obvious reasons, the total length of A and B exceeds half of\n> C, which looks quite misleading.\n>\n>          A | ++++++++++++--------\n>          B | ++++++++------------\n>          C | +++++++++++++++---------------\n\nBefore my patch is completely forgotten, let me critique the current\napproach. Currently everything is great and beautiful unless one\nparticular change adds a couple of hundred lines, say, to a man page.\nWith large changes in play, small changes are squashed to a single\ncharacter. Would you argue that this scenario correctly represent\nimportance of man pages? Would you say, that it's not misleading that\n1-, 2-, and 5-liners all look the same as long as a man page is\nprominently shown? Moreover, 1-, 2-, and 5- liners may look different\ndepending on the size of that man page. The current approach is not\ninvariant; it is, however, normalized as needed. \"Normalized\" is good,\n\"as needed\" is bad.\n\nWith asymptotic scaling, 1-, 2-, and 5- liners are correctly\nrepresented by a correct number of characters, regardless of the size\nof that man page. 10- and 20- liners are _slightly_ distorted. I\ncannot stress it more: the representation will not depend on the size\nof changes in other files! You will be able to tell where truly large\nchanges happened too! The price for this is that you won't be able to\nprecisely compare the sizes of added man pages.\n\nIt is your choice...\n"},{"id":"28771","messageId":"7v7iz290py.fsf@assigned-by-dhcp.cox.net","threadId":"5905","inReplyTo":"d620685f0610130656u55079a1fkc2c98a82f3aa4a33@mail.gmail.com","subject":"Re: [PATCH 1/2] diff --stat: use asymptotic scaling in graph","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-10-14T19:06:01Z","receivedAt":"2006-10-14T19:06:01Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"apodtele <apodtele@gmail.com> writes:\n\n> Before my patch is completely forgotten, let me critique the current\n> approach. Currently everything is great and beautiful unless one\n> particular change adds a couple of hundred lines, say, to a man page.\n> With large changes in play, small changes are squashed to a single\n> character. Would you argue that this scenario correctly represent\n> importance of man pages? Would you say, that it's not misleading that\n> 1-, 2-, and 5-liners all look the same as long as a man page is\n> prominently shown? Moreover, 1-, 2-, and 5- liners may look different\n> depending on the size of that man page. The current approach is not\n> invariant; it is, however, normalized as needed. \"Normalized\" is good,\n> \"as needed\" is bad.\n\nOne thing that mildly irritates me has been:\n\n\tgit log --stat v2.6.17..\n\nwhich, as you correctly point out, shows the bad effect of\nscaling per commit.  \"Normalized as needed\" is good.  What's bad\nis \"not normalizing across things we show\".\n\nEven with your non-linear scaling, you would need to make sure\nevery commit gets the same graph width; I do not think they\ncurrently do, due to name part scaling.\n\nPeople are used to seeing the traditional diffstat output, so\nany improvement you make that is different from it (including\ne.g. \"being able to show differences between 1- and 2- liner\npatch when a monster 800- liner happens to be in the same patch\nset\", which is a worthwhile goal) will look bizarre and/or\nmisleading to them and they would not like it.\n\nWith the change to align things in the middle, it might become\neasier to accept, because then it is _so_ obviously different\nfrom traditional diffstat, it is very clear to people that the\noutput is different but still they can easily figure out that\nlonger bars are for larger changes.\n\nAnd this new output needs to be an option.\n"}]}