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

Re: [PATCH v2 2/3] Adjust stat width calculations to take --graph output into account

From
Lucian Poston <lucian.poston@gmail.com>
Date
Mar 23, 2012, 04:38 UTC
Message-ID
<CACz_eycFU564bz1aO6-QF3=6GV8oHvGYfMWHRfgT1-j9AcAX-g@mail.gmail.com>
In-Reply-To
<4F6B8B59.4010106@in.waw.pl>
2012/3/22 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>:
Show 36 quoted lines
> On 03/22/2012 08:27 PM, Lucian Poston wrote:
>>
>> The recent change to compute the width of diff --stat did not take into
>> consideration the output from --graph. The consequence is that when both
>> options are used, e.g. in 'log --stat --graph', the lines are too long.
>>
>> Adjust stat width calculations to take --graph output into account.
>
> (1)
>
>> Adjust stat width calculations to reserve space for required characters
>> before
>> scaling the widths for the filename and graph portions of the diff-stat.
>> For
>> example, consider:
>>
>> " diff.c |   66 ++-"
>>
>> Before calculating the widths allocated to the filename, "diff.c", and the
>> graph, "++-", reserve space for the initial " " and the part between the
>> filename and graph portions " |   66 ". Then, divide the remaining space
>> so
>> that 5/8ths is given to the filename and 3/8ths for the graph.
>
> (2)
>
> Hi,
>
> I think that (1) is good. It fixes the bug and even makes the code more
> readable. But (2) should be separated, IMHO... There was a motivation for
> the layout in 1b058bc30df5f: not changing previous behaviour ("... at least
> 5/8 of available space is devoted to filenames. On a standard 80 column
> terminal, or if not connected to a terminal and using the default of 80
> columns, this gives the same partition as before.").
> (2) would change the way format-patch --stat output looks, which probably is
> not wanted.

I suppose changing the format of format-patch --stat output could be annoying to anyone expecting it to remain unchanged. I'll update the patch so that the diff-stat output using the default of 80 columns remains unmodified.

Previous: Zbigniew Jędrzejewski-SzmekNext: Junio C Hamano
Message 4 of 15 in “Add output_prefix_length to diff_options”
  1. 1/3 Add output_prefix_length to diff_optionsLucian Poston, Mar 22, 2012
  2. 2/3 Adjust stat width calculations to take --graph output into accountLucian Poston, Mar 22, 2012
  3. Zbigniew Jędrzejewski-SzmekMar 22, 2012
  4. Lucian PostonMar 23, 2012
  5. Junio C HamanoMar 22, 2012
  6. Lucian PostonMar 23, 2012
  7. Lucian PostonMar 23, 2012
  8. Zbigniew Jędrzejewski-SzmekMar 23, 2012
  9. Lucian PostonApr 12, 2012
  10. Zbigniew Jędrzejewski-SzmekApr 12, 2012
  11. Lucian PostonApr 16, 2012
  12. Junio C HamanoMar 23, 2012
  13. Lucian PostonApr 12, 2012
  14. 3/3 t4052: Test that stat width is adjusted for prefixesLucian Poston, Mar 22, 2012
  15. Lucian PostonMar 23, 2012

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.