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

Re: [PATCH v4 1/4] Add log.mailmap as configurational option for mailmap location

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 5, 2009, 17:44 UTC
Message-ID
<7vljskeq21.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<565c86bdbc8d6303d7d468fa196fb54ff7bd2352.1233819451.git.marius@trolltech.com>
Marius Storm-Olsen <marius@trolltech.com> writes:
Show 25 quoted lines
> diff --git a/config.c b/config.c
> index 790405a..9ebcbbe 100644
> --- a/config.c
> +++ b/config.c
> @@ -565,6 +565,13 @@ static int git_default_branch_config(const char *var, const char *value)
>  	return 0;
>  }
>  
> +static int git_default_log_config(const char *var, const char *value)
> +{
> +	if (!strcmp(var, "log.mailmap"))
> +		return git_config_string(&git_log_mailmap, var, value);
> +	return 0;
> +}
> +
>  int git_default_config(const char *var, const char *value, void *dummy)
>  {
>  	if (!prefixcmp(var, "core."))
> @@ -579,6 +586,9 @@ int git_default_config(const char *var, const char *value, void *dummy)
>  	if (!prefixcmp(var, "branch."))
>  		return git_default_branch_config(var, value);
>  
> +	if (!prefixcmp(var, "log."))
> +		return git_default_log_config(var, value);
> +

The placement of this looked *really* wrong, as mailmap is not *that* important to most of the commands.

Initially I wondered if this should be better done inside existing git_log_config(). I suspect that the reason you didn't do so is because you would want to use this also in blame, which is not part of the log family, and does not use git_log_config() (nor it should).

Which probably means that the code can stay here (it is just two strcmp and assignment to a pointer variable), but also suggests that log.mailmap is perhaps misnamed.

Previous: Marius Storm-OlsenNext: Marius Storm-Olsen
Message 6 of 8 in “Extend mailmap functionality”
  1. 0/4 Extend mailmap functionalityMarius Storm-Olsen, Feb 5, 2009
  2. 1/4 Add log.mailmap as configurational option for mailmap locationMarius Storm-Olsen, Feb 5, 2009
  3. 2/4 Add find_insert_index, insert_at_index and clear_func functions to string_listMarius Storm-Olsen, Feb 5, 2009
  4. 3/4 Add map_user() and clear_mailmap() to mailmapMarius Storm-Olsen, Feb 5, 2009
  5. 4/4 Change current mailmap usage to do matching on both name and email of author/committer.Marius Storm-Olsen, Feb 5, 2009
  6. Junio C HamanoFeb 5, 2009
  7. Marius Storm-OlsenFeb 5, 2009
  8. Junio C HamanoFeb 5, 2009

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.