From: Junio C Hamano <gitster@pobox.com>
To: Pierre Habouzit <madcoder@debian.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 1/1] --color and --no-color git-log options don't need diffs to be computed.
Date: Sat, 29 Sep 2007 10:02:47 -0700 [thread overview]
Message-ID: <7v4phdl808.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <20070929123724.01BB045EC@madism.org> (Pierre Habouzit's message of "Sat, 29 Sep 2007 14:35:56 +0200")
Pierre Habouzit <madcoder@debian.org> writes:
> Signed-off-by: Pierre Habouzit <madcoder@debian.org>
> ---
>
> revision.c | 5 +++--
> 1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/revision.c b/revision.c
> index 33d092c..0dee835 100644
> --- a/revision.c
> +++ b/revision.c
> @@ -1209,8 +1209,9 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
>
> opts = diff_opt_parse(&revs->diffopt, argv+i, argc-i);
> if (opts > 0) {
> - if (strcmp(argv[i], "-z"))
> - revs->diff = 1;
> + revs->diff = strcmp(argv[i], "-z")
> + && strcmp(argv[i], "--color")
> + && strcmp(argv[i], "--no-color");
> i += opts - 1;
> continue;
> }
Aside from the "don't override the option that is already set"
comment from David, I am somewhat unhappy that this piece
already knows too much about which option to diff potentially
changes the output (but not commits us to produce the diff) and
which option causes us to actually produce output.
prev parent reply other threads:[~2007-09-29 17:03 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-29 10:02 Big performance regression with --no-color option in git-log Marco Costalba
2007-09-29 11:01 ` Pierre Habouzit
2007-09-29 11:09 ` Pierre Habouzit
2007-09-29 11:29 ` Marco Costalba
2007-09-29 12:35 ` [PATCH 1/1] --color and --no-color git-log options don't need diffs to be computed Pierre Habouzit
2007-09-29 12:52 ` David Kastrup
2007-09-29 12:56 ` Pierre Habouzit
2007-09-29 13:06 ` Marco Costalba
2007-09-29 13:07 ` Marco Costalba
2007-09-29 16:50 ` Fix revision log diff setup, avoid unnecessary diff generation Linus Torvalds
2007-09-29 22:11 ` Junio C Hamano
2007-09-29 17:02 ` 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=7v4phdl808.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=madcoder@debian.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.
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).