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

[RFC] mailmap.blob overrides default .mailmap

From
CWCornelius Weig <cornelius.weig@tngtech.com>
Date
Feb 7, 2017, 11:56 UTC
Message-ID
<77c0182b-8c4f-9727-f56f-d8e2bad8146d@tngtech.com>
Hi,
 I was reading into the mailmap handling today and I'm a bit puzzled by the overriding behavior.
This is what the documentation says about precedence (emphasis mine):
-------------
mailmap.file
    The location of an augmenting mailmap file. The default mailmap, located
    in the root of the repository, is loaded first, then the mailmap file
    pointed to by this variable. The location of the mailmap file may be in a
    repository subdirectory, or somewhere outside of the repository itself.
    See git-shortlog(1) and git-blame(1).
mailmap.blob
    Like mailmap.file, but consider the value as a reference to a blob in the
    repository. If both mailmap.file and mailmap.blob are given, both are
!!! parsed, with _entries from mailmap.file taking precedence_. In a bare
    repository, this defaults to HEAD:.mailmap. In a non-bare repository, it
    defaults to empty.
------------
So from the doc I would have expected that files always get precedence over the blob. IOW entries from .mailmap override entries from mailmap.blob. However, this is not the case.
The code shows why (mailmap.c):
	err |= read_mailmap_file(map, ".mailmap", repo_abbrev);
	if (startup_info->have_repository)
		err |= read_mailmap_blob(map, git_mailmap_blob, repo_abbrev);
	err |= read_mailmap_file(map, git_mailmap_file, repo_abbrev);
Apparently this is not an oversight, because there is an explicit test for this overriding behavior (t4203 'mailmap.blob overrides .mailmap').
So I wonder: what is the rationale behind this? I find this mixed overriding behavior hard to explain and difficult to understand.
Next: Stefan Beller
Message 1 of 5 in “[RFC] mailmap.blob overrides default .mailmap”
  1. Cornelius WeigFeb 7, 2017
  2. Stefan BellerFeb 7, 2017
  3. Jeff KingFeb 7, 2017
  4. Cornelius WeigFeb 7, 2017
  5. Jeff KingFeb 8, 2017

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.