From: Junio C Hamano <gitster@pobox.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Stefan Beller <sbeller@google.com>,
Git Mailing List <git@vger.kernel.org>
Subject: Re: diffstat summary mode change bug
Date: Thu, 28 Sep 2017 13:12:23 +0900 [thread overview]
Message-ID: <xmqqd16b31i0.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <CA+55aFzThd6cayUVuv39k=sb8KCphLkWGCV4n2HUjfn7Pxkd3g@mail.gmail.com> (Linus Torvalds's message of "Wed, 27 Sep 2017 11:15:04 -0700")
Linus Torvalds <torvalds@linux-foundation.org> writes:
> and the reason seems to be that the '\n' at the end got dropped as the
> old code was very confusing (the old code had two different '\n' cases
> for the "show filename or not").
>
> I think the right fix is this whitespace-damaged trivial one-liner:
>
> diff --git a/diff.c b/diff.c
> index 3c6a3e0fa..653bb2e72 100644
> --- a/diff.c
> +++ b/diff.c
> @@ -5272,6 +5272,7 @@ static void show_mode_change(struct
> diff_options *opt, struct diff_filepair *p,
> strbuf_addch(&sb, ' ');
> quote_c_style(p->two->path, &sb, NULL, 0);
> }
> + strbuf_addch(&sb, '\n');
> emit_diff_symbol(opt, DIFF_SYMBOL_SUMMARY,
> sb.buf, sb.len, 0);
> strbuf_release(&sb);
>
> but somebody should double-check that.
>
> Linus
Thanks for being extra gentle by mentioning "old code was very
confusing", but it was not necessary. We should have caught this
breakage during the review, but I somehow failed to spot it. My
bad.
Thanks for a fix.
prev parent reply other threads:[~2017-09-28 4:12 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-27 18:15 diffstat summary mode change bug Linus Torvalds
2017-09-27 20:40 ` Stefan Beller
2017-09-27 21:02 ` Linus Torvalds
2017-09-27 21:09 ` Stefan Beller
2017-09-27 21:58 ` [PATCH] diff: correct newline in summary for renamed files Stefan Beller
2017-09-27 22:04 ` Linus Torvalds
2017-09-27 22:09 ` Jeff King
2017-09-27 22:32 ` Jeff King
2017-09-27 22:39 ` Stefan Beller
2017-09-27 22:49 ` Jeff King
2017-09-27 22:51 ` Stefan Beller
2017-09-27 23:15 ` Jonathan Nieder
2017-09-27 23:49 ` Ramsay Jones
2017-09-27 23:57 ` Stefan Beller
2017-09-28 0:39 ` Jeff King
2017-09-28 4:14 ` Junio C Hamano
2017-09-28 0:35 ` Jeff King
2017-09-27 22:34 ` Stefan Beller
2017-09-28 4:12 ` Junio C Hamano [this message]
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqd16b31i0.fsf@gitster.mtv.corp.google.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=sbeller@google.com \
--cc=torvalds@linux-foundation.org \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).