public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: Dan Aloni <alonid@gmail•com>
Cc: git@vger•kernel.org, Jeff King <peff@peff•net>
Subject: Re: [PATCH v4 3/3] ident.c: cleanup wrt ident's source
Date: Thu, 04 Feb 2016 13:33:27 -0800	[thread overview]
Message-ID: <xmqqd1scgnyw.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <1454577160-24484-4-git-send-email-alonid@gmail.com> (Dan Aloni's message of "Thu, 4 Feb 2016 11:12:40 +0200")

Dan Aloni <alonid@gmail•com> writes:

>  * Condense the variables that tells where we got the user's
>    ident into single enum, instead of a collection of booleans.
>  * Have {committer,author}_ident_sufficiently_given directly
>    probe the environment and the afformentioned enum instead of
>    relying on git_{committer,author}_info to do so.

That looks quite different from how we write our proposed log
messages.

>
> Signed-off-by: Dan Aloni <alonid@gmail•com>
> ---
>  ident.c | 122 ++++++++++++++++++++++++++++++++++++++++------------------------
>  1 file changed, 77 insertions(+), 45 deletions(-)
>
> diff --git a/ident.c b/ident.c
> index 1216079d0b0d..b9aad38e0621 100644
> --- a/ident.c
> +++ b/ident.c
> @@ -10,17 +10,19 @@
>  static struct strbuf git_default_name = STRBUF_INIT;
>  static struct strbuf git_default_email = STRBUF_INIT;
>  static struct strbuf git_default_date = STRBUF_INIT;
> -static int default_email_is_bogus;
> -static int default_name_is_bogus;
> +
> +enum ident_source {
> +	IDENT_SOURCE_UNKNOWN = 0,
> +	IDENT_SOURCE_CONFIG,
> +	IDENT_SOURCE_ENVIRONMENT,
> +	IDENT_SOURCE_GUESSED,
> +	IDENT_SOURCE_GUESSED_BOGUS,
> +};

No trailing comma after the last enum (some compliers choke on this
IIRC).

I skimmed the remainder of the patch but I am no the fence--I cannot
quite see how this improves the readability of the result.

Thanks.

  reply	other threads:[~2016-02-04 21:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-04  9:12 [PATCH v4] Add user.useConfigOnly boolean for when ident shouldn't be guessed Dan Aloni
2016-02-04  9:12 ` [PATCH v4 1/3] fmt_ident: refactor strictness checks Dan Aloni
2016-02-04  9:12 ` [PATCH v4 2/3] Add user.useConfigOnly boolean for when ident shouldn't be guessed Dan Aloni
2016-02-04 21:53   ` Junio C Hamano
2016-02-05  6:47     ` Dan Aloni
2016-02-04  9:12 ` [PATCH v4 3/3] ident.c: cleanup wrt ident's source Dan Aloni
2016-02-04 21:33   ` Junio C Hamano [this message]
2016-02-04 22:42   ` Junio C Hamano
2016-02-05  6:40     ` Dan Aloni

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=xmqqd1scgnyw.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=alonid@gmail$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=peff@peff$(echo .)net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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