Re: [PATCH v2 2/3] Adjust stat width calculations to take --graph output into account
- From
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
- Date
- Mar 22, 2012, 20:28 UTC
- Message-ID
- <4F6B8B59.4010106@in.waw.pl>
- In-Reply-To
- <1332444461-11957-2-git-send-email-lucian.poston@gmail.com>
On 03/22/2012 08:27 PM, Lucian Poston wrote:
Show 5 quoted lines
> 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)
Show 10 quoted lines
> 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.
- Zbyszek
Show 7 quoted lines
> Update the affected test, t4502. > > Signed-off-by: Lucian Poston<lucian.poston@gmail.com> > --- > diff.c | 66 ++++++++++++++++++++++++++++++++--------------- > t/t4052-stat-output.sh | 4 +- > 2 files changed, 47 insertions(+), 23 deletions(-)