mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <>
To: Junio C Hamano <>
Cc: Bryan Turner <>, SURA <>,
	Git Users <>
Subject: Re: [PATCH] mailmap: only look for .mailmap in work tree
Date: Wed, 10 Feb 2021 15:31:55 -0500	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On Wed, Feb 10, 2021 at 12:10:02PM -0800, Junio C Hamano wrote:

> >> OK.  Do we know at this point that cwd is always/already at the root
> >> level of the working tree?
> >
> > I think so. If we're in a non-bare repository, we'd have chdir'd during
> > the setup/discovery steps. At any rate, this patch could not possibly be
> > making such a situation _worse_, as we were previously reading it
> > unconditionally.
> But the point of the patch is to ensure that we only read from the
> top of the working tree---I wanted to make sure that we previously
> weren't reading it from any subdirectory the command started.

Ah, I see. I assume that part already worked, or people would be
complaining that "git shortlog" does not work from a subdirectory. :)

It doesn't look like we actually cover that in the test suite, though.
We can do that pretty easily:

diff --git a/t/ b/t/
index bf7a8add53..93caf9a46d 100755
--- a/t/
+++ b/t/
@@ -923,4 +923,13 @@ test_expect_success 'shortlog on stdin respects mailmap from repo' '
 	test_cmp expect actual
+test_expect_success 'find top-level mailmap from subdir' '
+	git clone loc-bare loc-wt &&
+	cp loc-bare/.mailmap loc-wt &&
+	mkdir loc-wt/subdir &&
+	git -C loc-wt/subdir log -1 --format=%aE >actual &&
+	echo >expect &&
+	test_cmp expect actual

I'll resend the whole thing with that squashed in, plus Eric's
documentation suggestion.


  reply	other threads:[~2021-02-10 20:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-01  3:05 I've noticed the command `git --git-dir=<path> shortlog` SURA
2021-02-05 16:57 ` Jeff King
2021-02-05 20:02   ` Bryan Turner
2021-02-09 17:29     ` [PATCH] mailmap: only look for .mailmap in work tree Jeff King
2021-02-09 19:00       ` Eric Sunshine
2021-02-09 22:16         ` Junio C Hamano
2021-02-10 16:05         ` Jeff King
2021-02-09 21:23       ` Junio C Hamano
2021-02-10 16:15         ` Jeff King
2021-02-10 20:10           ` Junio C Hamano
2021-02-10 20:31             ` Jeff King [this message]
2021-02-10 20:34               ` 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:

  List information:

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

  git send-email \ \ \ \ \ \ \

* 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

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).