From: Junio C Hamano <gitster@pobox.com>
To: "Zbigniew Jędrzejewski-Szmek" <zbyszek@in.waw.pl>
Cc: git@vger.kernel.org, Michael J Gruber <git@drmicha.warpmail.net>,
pclouds@gmail.com, j.sixt@viscovery.net
Subject: Re: [PATCH 0/8 v6] diff --stat: use the full terminal width
Date: Mon, 20 Feb 2012 23:05:34 -0800 [thread overview]
Message-ID: <7vr4xois3l.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <4F42E4C2.7070801@in.waw.pl> ("Zbigniew Jędrzejewski-Szmek"'s message of "Tue, 21 Feb 2012 01:26:42 +0100")
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> writes:
> On 02/21/2012 12:41 AM, Junio C Hamano wrote:
>> Zbigniew Jędrzejewski-Szmek<zbyszek@in.waw.pl> writes:
>>
>>> JC:
>>>> Perhaps the maximum for garph_width should be raised to something like
>>>> "min(80, stat_width) - name_width"?
>>> I think that a graph like
>>> a | 1000 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>>> b | 1 -
>>> is not very readable. I like the consistency forced by the 40-column limit.
>>> But I guess that this is very subjective.
>>
>> The above makes it very obvious that there is a huge amount of change made
>> to 'a' and a bit of deletion to 'b', compared to a mini-graph that is
>> truncated to half the screen width.
> Yes. But the same graph with 40 columns tells me exactly the same thing.
That is a bogus argument, isn't it? You can say the same thing if you
limited the length of the graph bars to 10-columns if you only compare
between 1000 and 1. You can even do with just 5-columns. For that matter,
without any graph bar at all, it tells us exactly the same thing because
we have numbers. Does that mean we do not need any bar? Of course not.
We use bars as visual aid.
Imagine what happens to the graph if you had paths with medium amount of
changes like 980, 800, 40, in addition to 1000 and 1. By limiting the
length of the bars more than necessary, you are losing the resolution
without a good reason, and that is why I find 40-column limit a poor
design choice.
>> Besides, the above is what you would get without your patch on 80-column
>> terminal, no?
>
> Yes.
I think this "use at most 40-places for the graph bar" was your response
to somebody's observation that "on 200-column terminal, we will still see
the commit log messages (and for many projects, also patch text) that are
designed to be comfortably viewable within the 80-column on the left, and
overlong graph bar stands out like an ugly sore thumb".
While that "ugliness" observation might be a valid one to make, I do not
think limiting the length of the graph bar without taking the length of
the name part into account at all is the right solution to it.
After all, that is exactly the same thinking that led to the bug in the
current code that you fixed with your series, isn't it? Our safety code
truncated the graph bar width too early without taking the width needed to
show the names into account, and then when the names turn out to be all
short, we ended up wasting space on the right hand side, because we made
the bars too short and the decision was made too early in the code.
If the problem you are addressing is to make sure that the diffstat part
in the series of lines that are structured like this:
log message part ~80 column
diff stat part that can extend very very very very very very very long
patch text part ~80 column
does not become overly long, wouldn't it be a more natural solution to
make sure that when the total (i.e. name and graph) length can fit to
align with the message and patch (i.e. traditional ~80 col regardless of
the terminal width), not to give it too much width? If the names are
short, like "a" and "b", that may result in graph bar part to use ~70
columns or so, and if the names are long, like in a Java project, you may
allocate 50 columns to the name and leave only 50 columns or so for the
graph part.
A simple heuristic might be to see if name part (without truncation) and
the graph part (without scaling) fits under 100-columns if the terminal is
wider than that, and if so limit the whole thing to 100-columns before
deciding the allocation of the total into two parts. If the name part
alone is very wide, showing the name and the graph using the whole
terminal width would give you a better result than using the bars that are
artificially capped to a short limit, I would imagine.
next prev parent reply other threads:[~2012-02-21 7:06 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-20 21:57 [PATCH 0/8 v6] diff --stat: use the full terminal width Zbigniew Jędrzejewski-Szmek
2012-02-20 21:57 ` [PATCH 1/8 v6] make lineno_width() from blame reusable for others Zbigniew Jędrzejewski-Szmek
2012-02-20 21:57 ` [PATCH 2/8 v6] diff --stat: tests for long filenames and big change counts Zbigniew Jędrzejewski-Szmek
2012-02-20 21:57 ` [PATCH 3/8 v6] diff --stat: use the full terminal width Zbigniew Jędrzejewski-Szmek
2012-02-20 21:57 ` [PATCH 4/8 v6] show " Zbigniew Jędrzejewski-Szmek
2012-02-20 21:57 ` [PATCH 5/8 v6] log " Zbigniew Jędrzejewski-Szmek
2012-02-20 21:57 ` [PATCH 6/8 v6] merge " Zbigniew Jędrzejewski-Szmek
2012-02-20 21:57 ` [PATCH 7/8 v6] diff --stat: limit graph part to 40 columns Zbigniew Jędrzejewski-Szmek
2012-02-20 21:57 ` [PATCH 8/8 v6] diff --stat: use less columns for change counts Zbigniew Jędrzejewski-Szmek
2012-02-20 23:41 ` [PATCH 0/8 v6] diff --stat: use the full terminal width Junio C Hamano
2012-02-21 0:26 ` Zbigniew Jędrzejewski-Szmek
2012-02-21 7:05 ` Junio C Hamano [this message]
2012-02-21 10:05 ` Zbigniew Jędrzejewski-Szmek
2012-02-21 20:10 ` Junio C Hamano
2012-02-22 11:24 ` Zbigniew Jędrzejewski-Szmek
2012-02-22 11:51 ` [PATCH 7.1/8] diff --stat: use a maximum of 5/8 for the filename part Zbigniew Jędrzejewski-Szmek
2012-02-22 11:51 ` [PATCH 7.2/8] diff --stat: add a test for output with COLUMNS=40 Zbigniew Jędrzejewski-Szmek
2012-02-22 11:51 ` [PATCH 7.3/8] diff --stat: limit graph part to 40 columns Zbigniew Jędrzejewski-Szmek
2012-02-22 19:41 ` [PATCH 0/8 v6] diff --stat: use the full terminal width Junio C Hamano
2012-02-24 20:31 ` [PATCH v7 0/11] " Zbigniew Jędrzejewski-Szmek
2012-02-24 20:32 ` [PATCH v7 01/11] make lineno_width() from blame reusable for others Zbigniew Jędrzejewski-Szmek
2012-02-24 20:32 ` [PATCH v7 02/11] diff --stat: tests for long filenames and big change counts Zbigniew Jędrzejewski-Szmek
2012-02-24 20:32 ` [PATCH v7 03/11] diff --stat: use the full terminal width Zbigniew Jędrzejewski-Szmek
2012-02-24 20:32 ` [PATCH v7 04/11] show " Zbigniew Jędrzejewski-Szmek
2012-02-24 20:32 ` [PATCH v7 05/11] log " Zbigniew Jędrzejewski-Szmek
2012-02-24 20:32 ` [PATCH v7 06/11] merge " Zbigniew Jędrzejewski-Szmek
2012-02-24 20:32 ` [PATCH v7 07/11] diff --stat: use a maximum of 5/8 for the filename part Zbigniew Jędrzejewski-Szmek
2012-02-24 20:32 ` [PATCH v7 08/11] diff --stat: add a test for output with COLUMNS=40 Zbigniew Jędrzejewski-Szmek
2012-02-24 20:32 ` [PATCH v7 09/11] diff --stat: enable limiting of the graph part Zbigniew Jędrzejewski-Szmek
2012-02-24 20:32 ` [PATCH v7 10/11] diff --stat: add config option to limit graph width Zbigniew Jędrzejewski-Szmek
2012-02-24 20:32 ` [PATCH v7 11/11] diff --stat: use less columns for change counts Zbigniew Jędrzejewski-Szmek
2012-02-21 15:16 ` [PATCH 0/8 v6] diff --stat: use the full terminal width Nguyen Thai Ngoc Duy
2012-02-21 16:11 ` Zbigniew Jędrzejewski-Szmek
2012-02-23 7:29 ` Miles Bader
2012-02-23 5:08 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vr4xois3l.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@drmicha.warpmail.net \
--cc=git@vger.kernel.org \
--cc=j.sixt@viscovery.net \
--cc=pclouds@gmail.com \
--cc=zbyszek@in.waw.pl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).