Re: [PATCH 3/3] mingw: use domain information for default email
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 16, 2018, 03:59 UTC
- Message-ID
- <xmqqbm7u35kb.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <271a5f57cef00d24ee33e99839cf3890e561efe7.1539596822.git.gitgitgadget@gmail.com>
"Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 10 quoted lines
> +char *mingw_query_user_email(void)
> +{
> + return get_extended_user_info(NameUserPrincipal);
> +}
> +
> ...
>
> +#ifndef query_user_email
> +#define query_user_email() NULL
> +#endifThe three patches look sensible to me; will queue.
You may already have audited our use of "struct passwd", "getpwnam()" and "getpwuid()"--I haven't. I think we use these only to learn user's email (to be used as the default ident) and home directory (to expand "git config --type=path"). If that is really the case, it may be a worthwhile clean-up to introduce our own API that offers these two exact functions, have the per-platform implementation of the API in compat/, and get rid of "struct passwd" and calls to getpw*() functions out of the core Git proper, to wean ourselves away from depending on POSIX too much.
But of course that is a separate topic.