From patchwork Thu Jul 11 18:37:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ariadne Conill X-Patchwork-Id: 11040675 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5CB5914DB for ; Thu, 11 Jul 2019 18:37:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 523A928AF4 for ; Thu, 11 Jul 2019 18:37:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 46DAC28B1B; Thu, 11 Jul 2019 18:37:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EAF7A28AF4 for ; Thu, 11 Jul 2019 18:37:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729531AbfGKShg (ORCPT ); Thu, 11 Jul 2019 14:37:36 -0400 Received: from mail-ot1-f66.google.com ([209.85.210.66]:42972 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729527AbfGKShf (ORCPT ); Thu, 11 Jul 2019 14:37:35 -0400 Received: by mail-ot1-f66.google.com with SMTP id l15so6865231otn.9 for ; Thu, 11 Jul 2019 11:37:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dereferenced-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=IV1auwxcdZtAwcxkvhE496emdG7y9WCOfhu9LZcvbE0=; b=Z48qUI0A/yUqSOTffm6Pj1rQKBRWy8yKK15/7H64lJOkEw9V1JhVhF+crH3cSw9h6D Zf6PDTr5rjuPth/oklkjjafF5idMWrHA7TsHysSW+aTCe3w7FYuYv9Ks9yGoHHZv1iuL Eh1FHEkGDldeoFeWzuqUaau16+IkKvS9HD1ab01qvmPjBL4c9CEW2w1Ag66uHDeDqvd7 3cwC6iiBOcIO5BW8YiGlmf5g5YL28qpiQvWSHQRlQut/TZdKAlKwHZOE1RptBAoP2yXe UxJ6JeF7bg7kz5woh6mkcBmJcopToO3wJH98j3YI7bworKAVWRsBkhzk6bcZNPh6Zm0r p/Kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=IV1auwxcdZtAwcxkvhE496emdG7y9WCOfhu9LZcvbE0=; b=SV/vbW/UFDqppJ9b4HEylFN5RohT1kWpluhyn56qpe2FAPG3HcRC2TKWFApHbgkYw4 CWc7fXkZI1CmmGfUXV+6ThOApF9Jydf7hYuccoBGgUlC1fGqRAJFZLkVzVTmfHLZB26J srVLoLrYqCMaiCO1JDYUTdpOLJ1NYmCtPpwchZhYu1kaH2SxSGZW1oRTOd37xi4moupw WIHBki0vJRv4XoAdOzln59AmJh8Nn4plS+5cTP0jZBn+DJaStpO/rcYGhiJ0DqsXm5XY yngC4nirblU931iUBd7+0fUfhNc1StMUMU64F9jaJoUlKp5PZEFES53ZvVxD/V2ylo+M ZmAQ== X-Gm-Message-State: APjAAAXrkMJoWTMeKZFxtx5ceS7p62lZwkCrg3juiCemycJG9XqByiAp teE2mw2R0XxJTGDWsxo8T9D6I/ep X-Google-Smtp-Source: APXvYqxH7ufX1kyG+7S07P+CMz1yOE1/QtJ3Lek7S1RbhAt2M3X6/VlRyP+/nB6rZdQlDP7kSR3oMw== X-Received: by 2002:a9d:5a16:: with SMTP id v22mr4446515oth.150.1562870254746; Thu, 11 Jul 2019 11:37:34 -0700 (PDT) Received: from nanabozho.attlocal.net ([2600:1700:8660:6160:5d50:4f59:ae8:3eb7]) by smtp.gmail.com with ESMTPSA id h9sm2016646otl.51.2019.07.11.11.37.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Jul 2019 11:37:34 -0700 (PDT) From: Ariadne Conill To: git@vger.kernel.org Cc: Ariadne Conill Subject: [PATCH v4 1/3] log: use mailmap by default Date: Thu, 11 Jul 2019 13:37:25 -0500 Message-Id: <20190711183727.8058-2-ariadne@dereferenced.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190711183727.8058-1-ariadne@dereferenced.org> References: <20190711183727.8058-1-ariadne@dereferenced.org> Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The `git log` command shows the author and committer name recorded in the git repository itself, while other commands respect `.mailmap` by default. I believe this is a bad design: it causes log entries to reflect inaccurate information: anyone who changes their name or e-mail address will not have that change (recorded in mailmap file) reflected when using `git log` by default. Anyone who explicitly wants the current behaviour can clearly request it by setting the `log.mailmap` setting to `false` in their `.gitconfig` file. Signed-off-by: Ariadne Conill --- builtin/log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/log.c b/builtin/log.c index 7c8767d3bc..3d2ce8fa3d 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -47,7 +47,7 @@ static int default_follow; static int default_show_signature; static int decoration_style; static int decoration_given; -static int use_mailmap_config; +static int use_mailmap_config = 1; static const char *fmt_patch_subject_prefix = "PATCH"; static const char *fmt_pretty; From patchwork Thu Jul 11 18:37:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ariadne Conill X-Patchwork-Id: 11040677 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F3F0014DB for ; Thu, 11 Jul 2019 18:37:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E7F4328AF4 for ; Thu, 11 Jul 2019 18:37:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DC7E328B1B; Thu, 11 Jul 2019 18:37:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8150728AF4 for ; Thu, 11 Jul 2019 18:37:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729539AbfGKShh (ORCPT ); Thu, 11 Jul 2019 14:37:37 -0400 Received: from mail-ot1-f65.google.com ([209.85.210.65]:35224 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729527AbfGKShg (ORCPT ); Thu, 11 Jul 2019 14:37:36 -0400 Received: by mail-ot1-f65.google.com with SMTP id j19so6898115otq.2 for ; Thu, 11 Jul 2019 11:37:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dereferenced-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=9pvuGvRpNslkGgP35JYJXws3HGI7F+ZmzR838BHuEec=; b=pfgkNRiPhJ1iLPGVRbtdIcMlrYu9Mdqkw718vAWugznCYdN/TP1NipK43SkcvXQvTC zxpohQXmPQa+3aASn6TcO9caqFiG31V44/qa5242IoIfaimfmP5JFrCg+8DuKMhoeX5K 0LXMQ7fGAtjLqTAMNhypvSMeC+hDTzfQvMeI9HnJz5K+d+8p4IY9OLGyGWBFiudOo08Q XX5hfBA/dX0HQY/TBj9O3fCUdcvqVF0kDWkZz+SsASYasS4y94jzMwQfnZYPv3qKiswS a1kVHmPLclJ+Y77NoPDtodByuHAGlRFuP1Bt5TxiK7IHxylBgAP1ZciF9tmEZikghwzN hjyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=9pvuGvRpNslkGgP35JYJXws3HGI7F+ZmzR838BHuEec=; b=UQpxxWBm4ev5l8xk11Q1vpun/u1+auVTMDjzIhegTZUSJ805Gvm6FMkIc1iLXJ5rE7 /hhqHBryGPboRsWqu+jsNP+yjHdlIVurZA/pLxJCrjexZSN2QvSMUFCY7oJ5egurfQ70 Fwg/S5jfqWQddxQQcC3ezFb6q3/I0CdaRDBJ2nKizuPdvlR8VWDwY70noBAkwaxqexBJ RO3DTepk/wbqNKKfKR8l9BARfw4FRCQgi40J8mm8QIYYhvAXN1IcIEQ6QbsAnJxfuHnt ++5aHXlz825jL997oH6X0fwh4HoeBjdoaQn93yykuBs4q9F3WwmVXH5QeTZG8lWAhmJ4 ZkpA== X-Gm-Message-State: APjAAAVj1e4bHscXAjdbqGxf3hqSssuUgDsysOm9/MeokHfJ+l9Y1al8 vVaCTKEk8Pk9TOZD6NNveDNbN9zk X-Google-Smtp-Source: APXvYqzs3cnKtF4gV5yeJk6d/MsDZCSQ6pf3reZKuFGi9e20VpInmq3OAOYbZe+2yoPxqKAl3kORbQ== X-Received: by 2002:a9d:5cc2:: with SMTP id r2mr4448242oti.122.1562870256092; Thu, 11 Jul 2019 11:37:36 -0700 (PDT) Received: from nanabozho.attlocal.net ([2600:1700:8660:6160:5d50:4f59:ae8:3eb7]) by smtp.gmail.com with ESMTPSA id h9sm2016646otl.51.2019.07.11.11.37.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Jul 2019 11:37:35 -0700 (PDT) From: Ariadne Conill To: git@vger.kernel.org Cc: Ariadne Conill Subject: [PATCH v4 2/3] log: document --no-use-mailmap option Date: Thu, 11 Jul 2019 13:37:26 -0500 Message-Id: <20190711183727.8058-3-ariadne@dereferenced.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190711183727.8058-1-ariadne@dereferenced.org> References: <20190711183727.8058-1-ariadne@dereferenced.org> Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When mailmap is enabled by default or by configuration, it may be useful to override the default behaviour. Previously, it was possible to enable the mailmap feature when it was disabled by default or in the configuration, but it was not possible to disable the mailmap feature when it was enabled by default or by the configuration. The previously undocumented --no-use-mailmap option equalizes this by allowing the user to explicitly enable or disable the mailmap feature according to their requirements. Signed-off-by: Ariadne Conill --- Documentation/config/log.txt | 4 ++-- Documentation/git-log.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/config/log.txt b/Documentation/config/log.txt index 78d9e4453a..8a01eed46b 100644 --- a/Documentation/config/log.txt +++ b/Documentation/config/log.txt @@ -39,5 +39,5 @@ log.showSignature:: linkgit:git-whatchanged[1] assume `--show-signature`. log.mailmap:: - If true, makes linkgit:git-log[1], linkgit:git-show[1], and - linkgit:git-whatchanged[1] assume `--use-mailmap`. + If false, makes linkgit:git-log[1], linkgit:git-show[1], and + linkgit:git-whatchanged[1] assume `--no-use-mailmap`. diff --git a/Documentation/git-log.txt b/Documentation/git-log.txt index b02e922dc3..b406bc4c48 100644 --- a/Documentation/git-log.txt +++ b/Documentation/git-log.txt @@ -49,7 +49,7 @@ OPTIONS Print out the ref name given on the command line by which each commit was reached. ---use-mailmap:: +--[no-]use-mailmap:: Use mailmap file to map author and committer names and email addresses to canonical real names and email addresses. See linkgit:git-shortlog[1]. From patchwork Thu Jul 11 18:37:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ariadne Conill X-Patchwork-Id: 11040679 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 436821395 for ; Thu, 11 Jul 2019 18:37:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 39A3428AF4 for ; Thu, 11 Jul 2019 18:37:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2DE7428B1B; Thu, 11 Jul 2019 18:37:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B272A28AF4 for ; Thu, 11 Jul 2019 18:37:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729545AbfGKShi (ORCPT ); Thu, 11 Jul 2019 14:37:38 -0400 Received: from mail-ot1-f65.google.com ([209.85.210.65]:36126 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729532AbfGKShi (ORCPT ); Thu, 11 Jul 2019 14:37:38 -0400 Received: by mail-ot1-f65.google.com with SMTP id r6so6883166oti.3 for ; Thu, 11 Jul 2019 11:37:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dereferenced-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=T5HgDcmCmGFRLPxSmjAeyz1noFR9+xePQ7dovYxMi2s=; b=0MLI/c3JzLuyHgxh9428VOWot8RzvumNDFROy407RK6N6QMXfKHJoPhxVeLvV20Dm9 C1RTA/pbCZHnLCmpV0IKBiWj8Aci/SWN9xMCQ8A8smwKF3kxGNDlmCqUuxmvELAtb/lL olQeHEaxwI2o0k6w3+7ucZM0QXiC6eMgcSvjdLirfLZ2vHVuzaJ/cH9DQnmxnB25/u/R yCS1VZ2RmK8JpkKRKUik9oWng2StD8MI1eIH3kbgFRebiWEYKaNAScwuJYeo3bwyqtxp jewxDuIP6roU+LWtNXC/Cd2Nb98p0yNJ2o4Qnhpx30pDHipRV4rYGkPYokJDbG40rQwB 86Uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=T5HgDcmCmGFRLPxSmjAeyz1noFR9+xePQ7dovYxMi2s=; b=pRZt+P0xK/1QW3ONf23t7o0dKo1JtnuJ9Jqa2j7SminLoKjUD9zP1pCdOTwH9ptjHJ Rv312Zj09TbbsuZEVbrhJUZjAQS/0X5gpITspwLNcwuRKcb7nde46NqTDSTTBqwXopdE sC49RCPzZL1NdgLSlL6j6xs1baSvM50RWnQlwvTaGWItfY2KzbbQx5juFkOh1PvN+G+e pU4l1vXyqDdP0Of6hLGGfDLXmKnDRciyPQP9vCsu1wM05ZIGF9p6YCvhSiyWiNR4yHHp Qd6p2F8PsN9yPN8q8Nz5mG6mjeD32v7B3SHOu2AIlCo17qHZHBKQGSyPCbeSElWTB0Py BgBA== X-Gm-Message-State: APjAAAVuoNCTRy1optX+3DGPOLjEozwsQmRSLHZykEcf3JjinxEAoFyD mgh3mA/tvTClP8kqVjZsSP0cwoDa X-Google-Smtp-Source: APXvYqwVPLOCHaR0upvs/00JFmDgXewadRBt8lBe3ck8ZAG/FilTKZuqn9GipxuKWRDMKd0ub2vYUA== X-Received: by 2002:a9d:65cb:: with SMTP id z11mr4669595oth.325.1562870257336; Thu, 11 Jul 2019 11:37:37 -0700 (PDT) Received: from nanabozho.attlocal.net ([2600:1700:8660:6160:5d50:4f59:ae8:3eb7]) by smtp.gmail.com with ESMTPSA id h9sm2016646otl.51.2019.07.11.11.37.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Jul 2019 11:37:36 -0700 (PDT) From: Ariadne Conill To: git@vger.kernel.org Cc: Ariadne Conill Subject: [PATCH v4 3/3] tests: rework mailmap tests for git log Date: Thu, 11 Jul 2019 13:37:27 -0500 Message-Id: <20190711183727.8058-4-ariadne@dereferenced.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190711183727.8058-1-ariadne@dereferenced.org> References: <20190711183727.8058-1-ariadne@dereferenced.org> Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In order to prove that the --no-use-mailmap option works as expected, we add a test for it which runs with -c log.mailmap=true to ensure that the option successfully negates the configured default. Additionally, since --use-mailmap is now the default behaviour, we remove mentions of --use-mailmap from the tests, since they are redundant. We also rework some tests to explicitly define the log.mailmap variable in both true and false states. Signed-off-by: Ariadne Conill --- t/t4203-mailmap.sh | 49 ++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 41 insertions(+), 8 deletions(-) diff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh index 43b1522ea2..3d6086ff96 100755 --- a/t/t4203-mailmap.sh +++ b/t/t4203-mailmap.sh @@ -422,8 +422,8 @@ Author: Some Dude Author: A U Thor EOF -test_expect_success 'Log output with --use-mailmap' ' - git log --use-mailmap | grep Author >actual && +test_expect_success 'Log output with mailmap enabled (default)' ' + git log | grep Author >actual && test_cmp expect actual ' @@ -437,18 +437,33 @@ Author: Some Dude Author: A U Thor EOF -test_expect_success 'Log output with log.mailmap' ' +test_expect_success 'Log output with log.mailmap enabled in config' ' git -c log.mailmap=True log | grep Author >actual && test_cmp expect actual ' +cat >expect <<\EOF +Author: CTO +Author: claus +Author: santa +Author: nick2 +Author: nick2 +Author: nick1 +Author: A U Thor +EOF + +test_expect_success 'Log output with log.mailmap disabled in config' ' + git -c log.mailmap=False log | grep Author >actual && + test_cmp expect actual +' + cat >expect <<\EOF Author: Santa Claus Author: Santa Claus EOF -test_expect_success 'Grep author with --use-mailmap' ' - git log --use-mailmap --author Santa | grep Author >actual && +test_expect_success 'Grep author with mailmap enabled (default)' ' + git log --author Santa | grep Author >actual && test_cmp expect actual ' cat >expect <<\EOF @@ -456,16 +471,34 @@ Author: Santa Claus Author: Santa Claus EOF -test_expect_success 'Grep author with log.mailmap' ' +test_expect_success 'Grep author with log.mailmap enabled' ' git -c log.mailmap=True log --author Santa | grep Author >actual && test_cmp expect actual ' -test_expect_success 'Only grep replaced author with --use-mailmap' ' - git log --use-mailmap --author "" >actual && +test_expect_success 'Grep author with log.mailmap disabled' ' + git -c log.mailmap=False log --author "" >actual && + test_must_be_empty actual +' + +test_expect_success 'Grep author with --no-use-mailmap' ' + git log --no-use-mailmap --author "" >actual && test_must_be_empty actual ' +test_expect_success 'Only grep replaced author with mailmap enabled' ' + git log --author "" >actual && + test_must_be_empty actual +' +cat >expect <<\EOF +Author: santa +EOF + +test_expect_success 'Grep author with --no-use-mailmap + log.mailmap=True' ' + git -c log.mailmap=True log --no-use-mailmap --author santa | grep Author >actual && + test_cmp expect actual +' + # git blame cat >expect <<\EOF ^OBJI (A U Thor DATE 1) one