git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 4, 2016, 21:33 UTC
Message-ID
<xmqqd1scgnyw.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<1454577160-24484-4-git-send-email-alonid@gmail.com>
Dan Aloni <alonid@gmail.com> writes:
Show 5 quoted lines
>  * 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.

Show 24 quoted lines
>
> 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.
Previous: Dan AloniNext: Junio C Hamano
Message 7 of 9 in “Add user.useConfigOnly boolean for when ident shouldn't be guessed”
  1. Add user.useConfigOnly boolean for when ident shouldn't be guessedDan Aloni, Feb 4, 2016
  2. 1/3 fmt_ident: refactor strictness checksDan Aloni, Feb 4, 2016
  3. 2/3 Add user.useConfigOnly boolean for when ident shouldn't be guessedDan Aloni, Feb 4, 2016
  4. Junio C HamanoFeb 4, 2016
  5. Dan AloniFeb 5, 2016
  6. 3/3 ident.c: cleanup wrt ident's sourceDan Aloni, Feb 4, 2016
  7. Junio C HamanoFeb 4, 2016
  8. Junio C HamanoFeb 4, 2016
  9. Dan AloniFeb 5, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.