Re: [PATCH v4 3/3] ident.c: cleanup wrt ident's source

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dan Aloni <alonid@xxxxxxxxx> 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@xxxxxxxxx>
> ---
>  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.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]