From: Junio C Hamano <gitster@pobox.com>
To: Lucian Poston <lucian.poston@gmail.com>
Cc: git@vger.kernel.org,
"Johannes Schindelin" <johannes.schindelin@gmx.de>,
"Michael J Gruber" <git@drmicha.warpmail.net>,
"Bo Yang" <struggleyb.nku@gmail.com>,
"Zbigniew Jędrzejewski-Szmek" <zbyszek@in.waw.pl>
Subject: Re: [PATCH v2 2/3] Adjust stat width calculations to take --graph output into account
Date: Thu, 22 Mar 2012 13:45:18 -0700 [thread overview]
Message-ID: <7vd384wejl.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <1332444461-11957-2-git-send-email-lucian.poston@gmail.com> (Lucian Poston's message of "Thu, 22 Mar 2012 12:27:40 -0700")
Lucian Poston <lucian.poston@gmail.com> 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?
next prev parent reply other threads:[~2012-03-22 20:45 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-22 19:27 [PATCH v2 1/3] Add output_prefix_length to diff_options Lucian Poston
2012-03-22 19:27 ` [PATCH v2 2/3] Adjust stat width calculations to take --graph output into account Lucian Poston
2012-03-22 20:28 ` Zbigniew Jędrzejewski-Szmek
2012-03-23 4:38 ` Lucian Poston
2012-03-22 20:45 ` Junio C Hamano [this message]
2012-03-23 4:44 ` Lucian Poston
2012-03-23 5:54 ` Lucian Poston
2012-03-23 10:12 ` Zbigniew Jędrzejewski-Szmek
2012-04-12 7:47 ` Lucian Poston
2012-04-12 10:17 ` Zbigniew Jędrzejewski-Szmek
2012-04-16 11:04 ` Lucian Poston
2012-03-23 18:13 ` Junio C Hamano
2012-04-12 8:35 ` Lucian Poston
2012-03-22 19:27 ` [PATCH v2 3/3] t4052: Test that stat width is adjusted for prefixes Lucian Poston
2012-03-23 5:57 ` Lucian Poston
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=7vd384wejl.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@drmicha.warpmail.net \
--cc=git@vger.kernel.org \
--cc=johannes.schindelin@gmx.de \
--cc=lucian.poston@gmail.com \
--cc=struggleyb.nku@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).