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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Lucian Poston <lucian.poston@xxxxxxxxx> writes:

Administrivia: You seem to be CC'ing people who haven't touched any of
the surrounding code for quite some time, including the now-defunct
address of mine.  Please don't.

> 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.
>
> Update the affected test, t4502.

That explains the regression you are introducing, but does not justify it.

When you start showing that line, do you already know how many columns at
the left edge of the display will be consumed by the ancestry graph part?

When the command is run without "--graph" option, the answer would
obviously be zero, but if it is non-zero, wouldn't it be a more sensible
solution to the problem to subtract that width from the total allowed
display width (e.g. on 200-column terminal, if the ancestry graph part at
the left edge uses 20-columns, you do exactly the same as the current
algorithm but use 180 as the width of the terminal).  When --stat-width is
explicitly given, that specifies the width of whatever comes after the
ancestry graph part, so there is no need to change anything.

Am I missing something, or is there something deeper going on?

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]