# [PATCH] config: respect '~' and '~user' in mailmap.file

3 messages from 2014-05-27 to 2014-05-27. Participants: Øystein Walle, Jeff King.
Thread: https://gitlist.dev/t/36758

## Øystein Walle, 2014-05-27 08:45

Subject: [PATCH] config: respect '~' and '~user' in mailmap.file
Message-ID: <1401180358-27281-1-git-send-email-oystwa@gmail.com>
URL: https://gitlist.dev/e/1401180358-27281-1-git-send-email-oystwa%40gmail.com

```
git_config_string() does not handle '~' and '~user' as part of the
value. Using git_config_pathname() fixes this.

Signed-off-by: Øystein Walle <oystwa@gmail.com>
---
 config.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/config.c b/config.c
index 314d8ee..ec7af5f 100644
--- a/config.c
+++ b/config.c
@@ -963,7 +963,7 @@ static int git_default_push_config(const char *var, const char *value)
 static int git_default_mailmap_config(const char *var, const char *value)
 {
 	if (!strcmp(var, "mailmap.file"))
-		return git_config_string(&git_mailmap_file, var, value);
+		return git_config_pathname(&git_mailmap_file, var, value);
 	if (!strcmp(var, "mailmap.blob"))
 		return git_config_string(&git_mailmap_blob, var, value);
 
-- 
2.0.0.rc4

```

## Jeff King, 2014-05-27 16:09

Subject: Re: [PATCH] config: respect '~' and '~user' in mailmap.file
Message-ID: <20140527160939.GA29693@sigill.intra.peff.net>
URL: https://gitlist.dev/e/20140527160939.GA29693%40sigill.intra.peff.net
In-Reply-To: <1401180358-27281-1-git-send-email-oystwa@gmail.com>

```
On Tue, May 27, 2014 at 10:45:58AM +0200, Øystein Walle wrote:

> git_config_string() does not handle '~' and '~user' as part of the
> value. Using git_config_pathname() fixes this.

Makes sense. Curious if there was a reason we did not use it in the
first place, I looked at the history. The reason is that mailmap.file
was added in d551a48 (2009-02-08) and git_config_pathname came months
later in 395de25 (2009-11-17). Retro-fitting it now should not cause a
problem for any sane paths. So:

Reviewed-by: Jeff King <peff@peff.net>

-Peff

```

## Øystein Walle, 2014-05-27 23:28

Subject: Re: [PATCH] config: respect '~' and '~user' in mailmap.file
Message-ID: <loom.20140528T012425-812@post.gmane.org>
URL: https://gitlist.dev/e/loom.20140528T012425-812%40post.gmane.org
In-Reply-To: <20140527160939.GA29693@sigill.intra.peff.net>

```
Jeff King <peff <at> peff.net> writes:

> 
> Makes sense. Curious if there was a reason we did not use it in the
> first place, I looked at the history. The reason is that mailmap.file
> was added in d551a48 (2009-02-08) and git_config_pathname came months
> later in 395de25 (2009-11-17). Retro-fitting it now should not cause a
> problem for any sane paths. So:
> 
> Reviewed-by: Jeff King <peff <at> peff.net>
> 
> -Peff
>
 
Thanks for the review. 

I saw it was added back in 2009 but didn't give it much thought other
than "Oh, that bug has been there for a long time!" :) (Not that this is
a serious bug as such, more than a slight inconsistency in how the path
is handled compared to other config values expected to be paths)

Øsse

```
