Re: [PATCH] Correct singular form in diff summary line for human interaction

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

 



Thomas Dickey <dickey@xxxxxxx> writes:

> On Wed, Feb 01, 2012 at 08:32:43AM +0700, Nguyen Thai Ngoc Duy wrote:
>> On Wed, Feb 1, 2012 at 12:50 AM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
>> >> If there is an environment variable to say "I don't want to see
>> >> variations on strings intended for humans", can it be spelled as
>> >> LC_ALL=C?
>> >
>> >  ...
>
> ... diffstat (google helped find context)

When we show diffstat from "git diff --stat" (or "git apply --stat"), we
currently do not do any singular/plural on the last line of the output
that summarizes the graph, ending up with:

	1 files changed, 1 insertions(+), 0 deletions(-)

when there is a single line insertion to a file and nothing else.

My recollection is that our behaviour originally came from our desire to
be as close as what "diffstat" produces, but that does not seem to be the
case.  I observed that the output from recent versions of "diffstat" is
much more human friendly.  We get these, depending on the input, from
"diffstat" version 1.53:

        1 file changed, 1 insertion(+)
        1 file changed, 1 deletion(-)
	0 files changed
	2 files changed, 3 insertions(+), 1 deletion(-)

Namely, it does singular/plural correctly, and omits unnecessary "0
deletions(-)" and "0 insertions(+)".

I was wondering if you remember what the behaviour of older versions of
"diffstat" was, and if it was changed to be more human friendly over
time. It is very possible that I am misremembering this and "diffstat" has
always done the singular/plural correctly and omitted useless "0 lines".

Somehow it seems hard to get hold of older versions of "diffstat", and I
was hoping that I could get that information straight out of the current
maintainer.

Thanks for responding and sorry for the lack of context of the original
message.

--
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]