From: Junio C Hamano <gitster@pobox.com>
To: Teng Long <dyroneteng@gmail.com>
Cc: git@vger.kernel.org, avarab@gmail.com, --cc=tenglong.tl@alibaba-inc.com
Subject: Re: [PATCH 1/1] range-diff: let '--abbrev' option takes effect
Date: Tue, 21 Feb 2023 14:01:37 -0800 [thread overview]
Message-ID: <xmqqzg96d6f2.fsf@gitster.g> (raw)
In-Reply-To: <20230220142444.18739-2-tenglong.tl@alibaba-inc.com> (Teng Long's message of "Mon, 20 Feb 2023 22:24:44 +0800")
Teng Long <dyroneteng@gmail.com> writes:
> diff --git a/range-diff.c b/range-diff.c
> index 8255ab43..086365df 100644
> --- a/range-diff.c
> +++ b/range-diff.c
> @@ -383,11 +383,14 @@ static void output_pair_header(struct diff_options *diffopt,
> const char *color_new = diff_get_color_opt(diffopt, DIFF_FILE_NEW);
> const char *color_commit = diff_get_color_opt(diffopt, DIFF_COMMIT);
> const char *color;
> + char abbrev = diffopt->abbrev;
> +
> + if (abbrev < 0)
> + abbrev = DEFAULT_ABBREV;
OK. I _think_ this explicit defaulting to DEFAULT_ABBREV does not
need to exist, as find_unique_abbrev() falls back to the default
when given a negative value anyway, but it is good to be explicit.
Will queue. Thanks.
next prev parent reply other threads:[~2023-02-21 22:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-20 14:24 [PATCH 0/1] range-diff: let '--abbrev' option takes effect Teng Long
2023-02-20 14:24 ` [PATCH 1/1] " Teng Long
2023-02-21 22:01 ` Junio C Hamano [this message]
2023-02-28 16:13 ` [PATCH] range-diff: avoid compiler warning when char is unsigned René Scharfe
2023-02-28 23:44 ` Junio C Hamano
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=xmqqzg96d6f2.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=--cc=tenglong.tl@alibaba-inc.com \
--cc=avarab@gmail.com \
--cc=dyroneteng@gmail.com \
--cc=git@vger.kernel.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).