From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>, git@vger.kernel.org
Subject: Re: [PATCH v2] line-log: suppress diff output with "-s"
Date: Mon, 11 Mar 2019 10:49:53 +0900 [thread overview]
Message-ID: <xmqqef7emb7i.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <20190308162031.GA17326@sigill.intra.peff.net> (Jeff King's message of "Fri, 8 Mar 2019 11:20:32 -0500")
Jeff King <peff@peff.net> writes:
> On Fri, Mar 08, 2019 at 04:38:44PM +0100, Johannes Schindelin wrote:
>
>> On Thu, 7 Mar 2019, Jeff King wrote:
>>
>> > When "-L" is in use, we ignore any diff output format that the user
>> > provides to us, and just always print a patch (with extra context lines
>> > covering the whole area of interest). It's not entirely clear what we
>> > should do with all formats (e.g., should "--stat" show just the diffstat
>> > of the touched lines, or the stat for the whole file?).
>> >
>> > But "-s" is pretty clear: the user probably wants to see just the
>> > commits that touched those lines, without any diff at all. Let's at
>> > least make that work.
>>
>> Agree. The patch looks obviously good.
>
> Thanks. This leaves the other formats as silently ignored. Do we want to
> do something like this:
It probably would make sense to do this if only to avoid surprises.
>
> diff --git a/revision.c b/revision.c
> index eb8e51bc63..a1b4fe2aa6 100644
> --- a/revision.c
> +++ b/revision.c
> @@ -2689,6 +2689,10 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
> if (revs->first_parent_only && revs->bisect)
> die(_("--first-parent is incompatible with --bisect"));
>
> + if (revs->line_level_traverse &&
> + (revs->diffopt.output_format & ~(DIFF_FORMAT_PATCH|DIFF_FORMAT_NO_OUTPUT)))
> + die(_("-L does not yet support diff formats besides -p and -s"));
> +
> if (revs->expand_tabs_in_log < 0)
> revs->expand_tabs_in_log = revs->expand_tabs_in_log_default;
>
>
> ?
>
> -Peff
prev parent reply other threads:[~2019-03-11 1:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-07 19:45 [PATCH v2] line-log: suppress diff output with "-s" Jeff King
2019-03-08 15:38 ` Johannes Schindelin
2019-03-08 16:20 ` Jeff King
2019-03-08 18:44 ` Johannes Schindelin
2019-03-11 3:54 ` Jeff King
2019-03-11 1:49 ` 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqef7emb7i.fsf@gitster-ct.c.googlers.com \
--to=gitster@pobox.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
/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).