git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Cornelius Weig <cornelius.weig@tngtech.com>
To: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: [RFC] mailmap.blob overrides default .mailmap
Date: Tue, 7 Feb 2017 12:56:00 +0100	[thread overview]
Message-ID: <77c0182b-8c4f-9727-f56f-d8e2bad8146d@tngtech.com> (raw)

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.


             reply	other threads:[~2017-02-07 11:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-07 11:56 Cornelius Weig [this message]
2017-02-07 17:27 ` [RFC] mailmap.blob overrides default .mailmap Stefan Beller
2017-02-07 19:28   ` Jeff King
2017-02-07 22:45     ` Cornelius Weig
2017-02-08 19:50       ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=77c0182b-8c4f-9727-f56f-d8e2bad8146d@tngtech.com \
    --to=cornelius.weig@tngtech.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).