{"thread":{"id":"50025","subject":"[RFC/PATCH] Use mailmap by default in log, show and whatchanged","startedAt":"2018-12-13T12:09:45Z","lastAt":"2018-12-13T13:49:33Z","messageCount":3,"participants":["CB Bailey","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"365239","messageId":"20181213120940.26477-1-cb@hashpling.org","threadId":"50025","inReplyTo":null,"subject":"[RFC/PATCH] Use mailmap by default in log, show and whatchanged","fromName":"CB Bailey","fromEmail":"cb@hashpling.org","sentAt":"2018-12-13T12:09:40Z","receivedAt":"2018-12-13T12:09:45Z","isPatch":true,"sender":{"key":"cb@hashpling.org","avatar":null},"body":"From: CB Bailey <cbailey32@bloomberg.net>\n\nPeople who have changed their name or email address will usually know\nthat they need to set 'log.mailmap' in order to have their new details\nreflected for old commits with 'git log', but others who interact with\nthem may not know or care enough to enable this option.\n\nChange the default for 'git log' and friends to always use mailmap so\nthat everyone gets to see canonical names and email addresses.\n\nSigned-off-by: CB Bailey <cbailey32@bloomberg.net>\n---\n\nRelated to my patch to make shortlog pass the mailmap into the revision\nwalker which may end up being configuratble behavior, I thought I'd\npropose this for discussion.\n\nFor people who change their names during their involvement in a project,\nit can be important that the people with whom they work only see their\ncorrect name, even when browsing old history.\n\nI had a dig around in the mailing list archives and couldn't find any\nspecific reason not to use a mailmap in log where one is in use. I did\nfind this message which suggests that it makes sense to make it the\ndefault for human-consumed formats. This patch doesn't affect\n\"--pretty=raw\" formatting.\n\n Documentation/config/log.txt |  4 ++--\n Documentation/git-log.txt    | 12 +++++++++---\n builtin/log.c                |  2 +-\n t/t4203-mailmap.sh           | 18 ++++++++++++++++++\n 4 files changed, 30 insertions(+), 6 deletions(-)\n\ndiff --git a/Documentation/config/log.txt b/Documentation/config/log.txt\nindex 78d9e4453a..8a01eed46b 100644\n--- a/Documentation/config/log.txt\n+++ b/Documentation/config/log.txt\n@@ -39,5 +39,5 @@ log.showSignature::\n \tlinkgit:git-whatchanged[1] assume `--show-signature`.\n \n log.mailmap::\n-\tIf true, makes linkgit:git-log[1], linkgit:git-show[1], and\n-\tlinkgit:git-whatchanged[1] assume `--use-mailmap`.\n+\tIf false, makes linkgit:git-log[1], linkgit:git-show[1], and\n+\tlinkgit:git-whatchanged[1] assume `--no-use-mailmap`.\ndiff --git a/Documentation/git-log.txt b/Documentation/git-log.txt\nindex 90761f1694..7815c9a6cb 100644\n--- a/Documentation/git-log.txt\n+++ b/Documentation/git-log.txt\n@@ -50,9 +50,11 @@ OPTIONS\n \tcommit was reached.\n \n --use-mailmap::\n-\tUse mailmap file to map author and committer names and email\n-\taddresses to canonical real names and email addresses. See\n-\tlinkgit:git-shortlog[1].\n+--no-use-mailmap::\n+\tUse (or don't use) mailmap file to map author and committer names and\n+\temail addresses to canonical real names and email addresses. The default\n+\tis to use the mailmap file, but this can be overriden with the\n+\t`log.mailmap` configuration option. See linkgit:git-shortlog[1].\n \n --full-diff::\n \tWithout this flag, `git log -p <path>...` shows commits that\n@@ -205,6 +207,10 @@ log.showRoot::\n \t`git log -p` output would be shown without a diff attached.\n \tThe default is `true`.\n \n+log.mailmap::\n+\tIf `false`, makes `git log` and related commands assume\n+\t`--no-use-mailmap`.\n+\n log.showSignature::\n \tIf `true`, `git log` and related commands will act as if the\n \t`--show-signature` option was passed to them.\ndiff --git a/builtin/log.c b/builtin/log.c\nindex e8e51068bd..41a5eefb20 100644\n--- a/builtin/log.c\n+++ b/builtin/log.c\n@@ -46,7 +46,7 @@ static int default_follow;\n static int default_show_signature;\n static int decoration_style;\n static int decoration_given;\n-static int use_mailmap_config;\n+static int use_mailmap_config = 1;\n static const char *fmt_patch_subject_prefix = \"PATCH\";\n static const char *fmt_pretty;\n \ndiff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh\nindex 43b1522ea2..efb145c4cd 100755\n--- a/t/t4203-mailmap.sh\n+++ b/t/t4203-mailmap.sh\n@@ -424,6 +424,24 @@ EOF\n \n test_expect_success 'Log output with --use-mailmap' '\n \tgit log --use-mailmap | grep Author >actual &&\n+\ttest_cmp expect actual &&\n+# --use-mailmap is the default\n+\tgit log | grep Author >actual &&\n+\ttest_cmp expect actual\n+'\n+\n+cat >expect <<\\EOF\n+Author: CTO <cto@coompany.xx>\n+Author: claus <me@company.xx>\n+Author: santa <me@company.xx>\n+Author: nick2 <nick2@company.xx>\n+Author: nick2 <bugs@company.xx>\n+Author: nick1 <bugs@company.xx>\n+Author: A U Thor <author@example.com>\n+EOF\n+\n+test_expect_success 'Log output with --no-use-mailmap' '\n+\tgit log --no-use-mailmap | grep Author >actual &&\n \ttest_cmp expect actual\n '\n \n-- \n2.20.0\n\n"},{"id":"365240","messageId":"20181213121203.zzzwaadf73cbfrkn@hashpling.org","threadId":"50025","inReplyTo":"20181213120940.26477-1-cb@hashpling.org","subject":"Re: [RFC/PATCH] Use mailmap by default in log, show and whatchanged","fromName":"CB Bailey","fromEmail":"cb@hashpling.org","sentAt":"2018-12-13T12:12:03Z","receivedAt":"2018-12-13T12:19:37Z","isPatch":true,"sender":{"key":"cb@hashpling.org","avatar":null},"body":"On Thu, Dec 13, 2018 at 12:09:40PM +0000, CB Bailey wrote:\n> I had a dig around in the mailing list archives and couldn't find any\n> specific reason not to use a mailmap in log where one is in use. I did\n> find this message which suggests that it makes sense to make it the\n> default for human-consumed formats. This patch doesn't affect\n> \"--pretty=raw\" formatting.\n\nThis week I'm having an issue with sending messages a few seconds before\nI've completed them.\n\nThis message:\nhttps://public-inbox.org/git/20121112231815.GE10531@sigill.intra.peff.net/\n\nCB\n"},{"id":"365250","messageId":"nycvar.QRO.7.76.6.1812131448540.43@tvgsbejvaqbjf.bet","threadId":"50025","inReplyTo":"20181213120940.26477-1-cb@hashpling.org","subject":"Re: [RFC/PATCH] Use mailmap by default in log, show and whatchanged","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2018-12-13T13:49:12Z","receivedAt":"2018-12-13T13:49:33Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi CB,\n\nOn Thu, 13 Dec 2018, CB Bailey wrote:\n\n> From: CB Bailey <cbailey32@bloomberg.net>\n> \n> People who have changed their name or email address will usually know\n> that they need to set 'log.mailmap' in order to have their new details\n> reflected for old commits with 'git log', but others who interact with\n> them may not know or care enough to enable this option.\n> \n> Change the default for 'git log' and friends to always use mailmap so\n> that everyone gets to see canonical names and email addresses.\n> \n> Signed-off-by: CB Bailey <cbailey32@bloomberg.net>\n> ---\n> \n> Related to my patch to make shortlog pass the mailmap into the revision\n> walker which may end up being configuratble behavior, I thought I'd\n> propose this for discussion.\n> \n> For people who change their names during their involvement in a project,\n> it can be important that the people with whom they work only see their\n> correct name, even when browsing old history.\n\nThis makes a ton of sense to me.\n\nThank you,\nDscho\n\n> \n> I had a dig around in the mailing list archives and couldn't find any\n> specific reason not to use a mailmap in log where one is in use. I did\n> find this message which suggests that it makes sense to make it the\n> default for human-consumed formats. This patch doesn't affect\n> \"--pretty=raw\" formatting.\n> \n>  Documentation/config/log.txt |  4 ++--\n>  Documentation/git-log.txt    | 12 +++++++++---\n>  builtin/log.c                |  2 +-\n>  t/t4203-mailmap.sh           | 18 ++++++++++++++++++\n>  4 files changed, 30 insertions(+), 6 deletions(-)\n> \n> diff --git a/Documentation/config/log.txt b/Documentation/config/log.txt\n> index 78d9e4453a..8a01eed46b 100644\n> --- a/Documentation/config/log.txt\n> +++ b/Documentation/config/log.txt\n> @@ -39,5 +39,5 @@ log.showSignature::\n>  \tlinkgit:git-whatchanged[1] assume `--show-signature`.\n>  \n>  log.mailmap::\n> -\tIf true, makes linkgit:git-log[1], linkgit:git-show[1], and\n> -\tlinkgit:git-whatchanged[1] assume `--use-mailmap`.\n> +\tIf false, makes linkgit:git-log[1], linkgit:git-show[1], and\n> +\tlinkgit:git-whatchanged[1] assume `--no-use-mailmap`.\n> diff --git a/Documentation/git-log.txt b/Documentation/git-log.txt\n> index 90761f1694..7815c9a6cb 100644\n> --- a/Documentation/git-log.txt\n> +++ b/Documentation/git-log.txt\n> @@ -50,9 +50,11 @@ OPTIONS\n>  \tcommit was reached.\n>  \n>  --use-mailmap::\n> -\tUse mailmap file to map author and committer names and email\n> -\taddresses to canonical real names and email addresses. See\n> -\tlinkgit:git-shortlog[1].\n> +--no-use-mailmap::\n> +\tUse (or don't use) mailmap file to map author and committer names and\n> +\temail addresses to canonical real names and email addresses. The default\n> +\tis to use the mailmap file, but this can be overriden with the\n> +\t`log.mailmap` configuration option. See linkgit:git-shortlog[1].\n>  \n>  --full-diff::\n>  \tWithout this flag, `git log -p <path>...` shows commits that\n> @@ -205,6 +207,10 @@ log.showRoot::\n>  \t`git log -p` output would be shown without a diff attached.\n>  \tThe default is `true`.\n>  \n> +log.mailmap::\n> +\tIf `false`, makes `git log` and related commands assume\n> +\t`--no-use-mailmap`.\n> +\n>  log.showSignature::\n>  \tIf `true`, `git log` and related commands will act as if the\n>  \t`--show-signature` option was passed to them.\n> diff --git a/builtin/log.c b/builtin/log.c\n> index e8e51068bd..41a5eefb20 100644\n> --- a/builtin/log.c\n> +++ b/builtin/log.c\n> @@ -46,7 +46,7 @@ static int default_follow;\n>  static int default_show_signature;\n>  static int decoration_style;\n>  static int decoration_given;\n> -static int use_mailmap_config;\n> +static int use_mailmap_config = 1;\n>  static const char *fmt_patch_subject_prefix = \"PATCH\";\n>  static const char *fmt_pretty;\n>  \n> diff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh\n> index 43b1522ea2..efb145c4cd 100755\n> --- a/t/t4203-mailmap.sh\n> +++ b/t/t4203-mailmap.sh\n> @@ -424,6 +424,24 @@ EOF\n>  \n>  test_expect_success 'Log output with --use-mailmap' '\n>  \tgit log --use-mailmap | grep Author >actual &&\n> +\ttest_cmp expect actual &&\n> +# --use-mailmap is the default\n> +\tgit log | grep Author >actual &&\n> +\ttest_cmp expect actual\n> +'\n> +\n> +cat >expect <<\\EOF\n> +Author: CTO <cto@coompany.xx>\n> +Author: claus <me@company.xx>\n> +Author: santa <me@company.xx>\n> +Author: nick2 <nick2@company.xx>\n> +Author: nick2 <bugs@company.xx>\n> +Author: nick1 <bugs@company.xx>\n> +Author: A U Thor <author@example.com>\n> +EOF\n> +\n> +test_expect_success 'Log output with --no-use-mailmap' '\n> +\tgit log --no-use-mailmap | grep Author >actual &&\n>  \ttest_cmp expect actual\n>  '\n>  \n> -- \n> 2.20.0\n> \n> \n"}]}