Re: [PATCH 1/3] diff --stat: allow custom diffstat output width.
- From
Junio C Hamano <junkio@cox.net>
- Date
- Sep 29, 2006, 01:35 UTC
- Message-ID
- <7vk63nsbec.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <Pine.LNX.4.64.0609281458420.3952@g5.osdl.org>
Linus Torvalds <torvalds@osdl.org> writes:
> You should probably check the "width" and "name_width" values for sanity.
The output code forces (well, at least tries to force) some sanity into these values when they are not, so probably we do not need it. If we want, we could check something like:
if (name_width < 10 || width - name_width < 15)
die("at least 10 for name, and 15+name for width please");The number 10 is totally arbitrary; among the total area that is given by width, after subtracting name_width, 10 columns are taken by left and right end space, vertical bar and numbers, so the above gives at least 5 columns to draw the graph.