From: Jeff King <peff@peff.net>
To: David Turner <dturner@twopensource.com>
Cc: git@vger.kernel.org, "Michael Haggerty" <mhagger@alum.mit.edu>,
"Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Subject: [PATCH 4/6] mailmap: do not resolve blobs in a non-repository
Date: Sat, 5 Mar 2016 17:13:29 -0500 [thread overview]
Message-ID: <20160305221329.GD31508@sigill.intra.peff.net> (raw)
In-Reply-To: <20160305220829.GA31316@sigill.intra.peff.net>
The mailmap code may be triggered outside of a repository by
git-shortlog. There is no point in looking up a name like
"HEAD:.mailmap" there; without a repository, we have no
refs.
This is unlikely to matter much in practice for the current
code, as we would simply fail to find the ref. But as the
refs code learns about new backends, this is more important;
without a repository, we do not even know which backend to
look at.
Signed-off-by: Jeff King <peff@peff.net>
---
I debated whether ".mailmap" in the $PWD should be respected in a
non-repository. If it were 2005, I think I could go either way. But it's
not, and changing it now seems like a pointless and unnecessary
regression, even if there is some grounds to argue for it.
mailmap.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/mailmap.c b/mailmap.c
index f4a0f1c..9726237 100644
--- a/mailmap.c
+++ b/mailmap.c
@@ -250,7 +250,8 @@ int read_mailmap(struct string_list *map, char **repo_abbrev)
git_mailmap_blob = "HEAD:.mailmap";
err |= read_mailmap_file(map, ".mailmap", repo_abbrev);
- err |= read_mailmap_blob(map, git_mailmap_blob, 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);
return err;
}
--
2.8.0.rc1.318.g2193183
next prev parent reply other threads:[~2016-03-05 22:13 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-05 22:08 [PATCH 0/6] avoid touching ref code in non-repositories Jeff King
2016-03-05 22:10 ` [PATCH 1/6] setup: make startup_info available everywhere Jeff King
2016-03-05 22:11 ` [PATCH 2/6] setup: set startup_info->have_repository more reliably Jeff King
2016-03-05 22:11 ` [PATCH 3/6] remote: don't resolve HEAD in non-repository Jeff King
2016-03-05 22:13 ` Jeff King [this message]
2016-03-05 22:15 ` [PATCH 5/6] grep: turn off gitlink detection for --no-index Jeff King
2016-03-07 1:29 ` Junio C Hamano
2016-03-07 15:51 ` [PATCH v2 " Jeff King
2016-03-05 22:16 ` [PATCH 6/6] use setup_git_directory() in test-* programs Jeff King
2016-03-07 1:28 ` Junio C Hamano
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160305221329.GD31508@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=dturner@twopensource.com \
--cc=git@vger.kernel.org \
--cc=mhagger@alum.mit.edu \
--cc=pclouds@gmail.com \
/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.
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 NNTP newsgroup(s).