Re: [PATCH 0/3 v2] diff --stat: use the real terminal width

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

 



Zbigniew Jędrzejewski-Szmek <zbyszek@xxxxxxxxx> writes:

> - style fixes

I think I still saw at least one malformatted multi-line comments in this
round, though (I stopped looking after I saw one, so there may be others).

> - some tests for git-format-patch added
> - patches 3 and 4 squashed together, since they touch the same lines
> - graph width is limited to 40 columns, even if there's more space

Hmm.

This is what we have in the documentation.

        --stat[=<width>[,<name-width>[,<count>]]]::
                Generate a diffstat.  You can override the default
                output width for 80-column terminal by `--stat=<width>`.
                The width of the filename part can be controlled by
                giving another width to it separated by a comma.

Naïvely, one would expect that a "use the real terminal width" series
would be only to learn the width of the terminal and tweak its hardcoded
default "80" to that width, and change nothing else, leaving the default
for name-width to "50", which still can be overridable if needed.

But the reason somebody wants to have a wider width is more often not
because they want to see longer bars, but because they want to see long
names without truncation, so in retrospect, the order the "--stat=" option
takes its values is inconvenient.  Users would more often want to tinker
with name-width than width because the latter can be auto-detected.

Which is a bit unfortunate.

In any case, the above needs to be updated to describe what the updated
logic does.  Do you have documentation updates in the series?

Judging from what you wrote in the above, the updated logic is, instead of
the "naïve" version:

 - auto-detect, if possible, to set the default "width" to COLUMNS instead
   of hardcoded 80; and

 - instead of using hardcoded 50, use width-40 as the default as the
   default "name-width".

But if that is what is going on, shouldn't your "40" be "30" to retain
backward compatibility for people who work on 80-column terminals?

Or is there something more complex going on that you are not describing
here?
--
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]