{"thread":{"id":"51481","subject":"[PATCH v3 0/3] document deprecation of log.mailmap=false default","startedAt":"2019-07-15T12:41:13Z","lastAt":"2019-07-15T12:41:17Z","messageCount":4,"participants":["Ariadne Conill"],"isPatch":true,"patchVersion":3,"patchTotal":3},"messages":[{"id":"378939","messageId":"20190715124106.12642-1-ariadne@dereferenced.org","threadId":"51481","inReplyTo":null,"subject":"[PATCH v3 0/3] document deprecation of log.mailmap=false default","fromName":"Ariadne Conill","fromEmail":"ariadne@dereferenced.org","sentAt":"2019-07-15T12:41:03Z","receivedAt":"2019-07-15T12:41:13Z","isPatch":true,"sender":{"key":"ariadne@dereferenced.org","avatar":"https://avatars.githubusercontent.com/u/1522444?v=4"},"body":"Based on the discussion of the previous patches, we concluded that\nchanging the default will require a transitional period.\n\nAs such, I have introduced a deprecation warning that is printed when\nthe log builtin commands are used.\n\nThanks to Junio and everyone else for providing feedback on how to\nproceed.\n\nNew in version 3:\n- Split interactive session detection in auto_decoration_style() into\n  it's own function.\n- Defang the tests in a more efficient way.\n\nNew in version 2:\n- The warning is disabled when `--format` is used.\n- The warning is disabled when not called from a controlling terminal.\n- Tests which fake a controlling terminal have been defanged.\n\nAriadne Conill (3):\n  log: add warning for unspecified log.mailmap setting\n  documentation: mention --no-use-mailmap and log.mailmap false setting\n  tests: defang pager tests by explicitly disabling the log.mailmap\n    warning\n\n Documentation/config/log.txt |  3 ++-\n Documentation/git-log.txt    |  2 +-\n builtin/log.c                | 26 ++++++++++++++++++++++++--\n t/t7006-pager.sh             |  2 ++\n 4 files changed, 29 insertions(+), 4 deletions(-)\n\n-- \n2.17.1\n\n"},{"id":"378940","messageId":"20190715124106.12642-2-ariadne@dereferenced.org","threadId":"51481","inReplyTo":"20190715124106.12642-1-ariadne@dereferenced.org","subject":"[PATCH v3 1/3] log: add warning for unspecified log.mailmap setting","fromName":"Ariadne Conill","fromEmail":"ariadne@dereferenced.org","sentAt":"2019-07-15T12:41:04Z","receivedAt":"2019-07-15T12:41:14Z","isPatch":true,"sender":{"key":"ariadne@dereferenced.org","avatar":"https://avatars.githubusercontent.com/u/1522444?v=4"},"body":"Based on discussions around changing the log.mailmap default to being\nenabled, it was decided that a transitional period is required.\n\nAccordingly, we announce this transitional period with a warning\nmessage.\n\nSigned-off-by: Ariadne Conill <ariadne@dereferenced.org>\n---\n builtin/log.c | 26 ++++++++++++++++++++++++--\n 1 file changed, 24 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin/log.c b/builtin/log.c\nindex 7c8767d3bc..1cf9e37736 100644\n--- a/builtin/log.c\n+++ b/builtin/log.c\n@@ -47,7 +47,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@@ -63,9 +63,14 @@ struct line_opt_callback_data {\n \tstruct string_list args;\n };\n \n+static int session_is_interactive(void)\n+{\n+\treturn isatty(1) || pager_in_use();\n+}\n+\n static int auto_decoration_style(void)\n {\n-\treturn (isatty(1) || pager_in_use()) ? DECORATE_SHORT_REFS : 0;\n+\treturn session_is_interactive() ? DECORATE_SHORT_REFS : 0;\n }\n \n static int parse_decoration_style(const char *value)\n@@ -151,6 +156,16 @@ static void cmd_log_init_defaults(struct rev_info *rev)\n \t\tparse_date_format(default_date_mode, &rev->date_mode);\n }\n \n+static char warn_unspecified_mailmap_msg[] =\n+N_(\"log.mailmap is not set; its implicit value will change in an\\n\"\n+   \"upcoming release. To squelch this message and preserve current\\n\"\n+   \"behaviour, set the log.mailmap configuration value to false.\\n\"\n+   \"\\n\"\n+   \"To squelch this message and adopt the new behaviour now, set the\\n\"\n+   \"log.mailmap configuration value to true.\\n\"\n+   \"\\n\"\n+   \"See 'git help config' and search for 'log.mailmap' for further information.\");\n+\n static void cmd_log_init_finish(int argc, const char **argv, const char *prefix,\n \t\t\t struct rev_info *rev, struct setup_revision_opt *opt)\n {\n@@ -199,6 +214,13 @@ static void cmd_log_init_finish(int argc, const char **argv, const char *prefix,\n \tmemset(&w, 0, sizeof(w));\n \tuserformat_find_requirements(NULL, &w);\n \n+\tif (mailmap < 0) {\n+\t\tif (session_is_interactive() && !rev->pretty_given)\n+\t\t\twarning(\"%s\\n\", _(warn_unspecified_mailmap_msg));\n+\n+\t\tmailmap = 0;\n+\t}\n+\n \tif (!rev->show_notes_given && (!rev->pretty_given || w.notes))\n \t\trev->show_notes = 1;\n \tif (rev->show_notes)\n-- \n2.17.1\n\n"},{"id":"378941","messageId":"20190715124106.12642-3-ariadne@dereferenced.org","threadId":"51481","inReplyTo":"20190715124106.12642-1-ariadne@dereferenced.org","subject":"[PATCH v3 2/3] documentation: mention --no-use-mailmap and log.mailmap false setting","fromName":"Ariadne Conill","fromEmail":"ariadne@dereferenced.org","sentAt":"2019-07-15T12:41:05Z","receivedAt":"2019-07-15T12:41:16Z","isPatch":true,"sender":{"key":"ariadne@dereferenced.org","avatar":"https://avatars.githubusercontent.com/u/1522444?v=4"},"body":"The log.mailmap setting may be explicitly set to false, which disables\nthe mailmap feature implicity. In practice, doing so is equivalent to\nalways using the previously undocumented --no-use-mailmap option on the\ncommand line.\n\nAccordingly, we document both the existence of --no-use-mailmap as\nwell as briefly discuss the equivalence of it to log.mailmap=False.\n\nSigned-off-by: Ariadne Conill <ariadne@dereferenced.org>\n---\n Documentation/config/log.txt | 3 ++-\n Documentation/git-log.txt    | 2 +-\n 2 files changed, 3 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/config/log.txt b/Documentation/config/log.txt\nindex 78d9e4453a..7798e10cb0 100644\n--- a/Documentation/config/log.txt\n+++ b/Documentation/config/log.txt\n@@ -40,4 +40,5 @@ log.showSignature::\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+\tlinkgit:git-whatchanged[1] assume `--use-mailmap`, otherwise\n+\tassume `--no-use-mailmap`. False by default.\ndiff --git a/Documentation/git-log.txt b/Documentation/git-log.txt\nindex b02e922dc3..b406bc4c48 100644\n--- a/Documentation/git-log.txt\n+++ b/Documentation/git-log.txt\n@@ -49,7 +49,7 @@ OPTIONS\n \tPrint out the ref name given on the command line by which each\n \tcommit was reached.\n \n---use-mailmap::\n+--[no-]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-- \n2.17.1\n\n"},{"id":"378942","messageId":"20190715124106.12642-4-ariadne@dereferenced.org","threadId":"51481","inReplyTo":"20190715124106.12642-1-ariadne@dereferenced.org","subject":"[PATCH v3 3/3] tests: defang pager tests by explicitly disabling the log.mailmap warning","fromName":"Ariadne Conill","fromEmail":"ariadne@dereferenced.org","sentAt":"2019-07-15T12:41:06Z","receivedAt":"2019-07-15T12:41:17Z","isPatch":true,"sender":{"key":"ariadne@dereferenced.org","avatar":"https://avatars.githubusercontent.com/u/1522444?v=4"},"body":"In the previous patch, we added a deprecation warning for the current\nlog.mailmap setting. This warning only appears when git is attached to\na controlling terminal. Some tests however run under an emulated\nterminal, so we need to disable the warning for those tests.\n\nThanks to Junio for suggesting that we do this in the setup function.\n\nSigned-off-by: Ariadne Conill <ariadne@dereferenced.org>\n---\n t/t7006-pager.sh | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/t/t7006-pager.sh b/t/t7006-pager.sh\nindex 00e09a375c..7976fa7bcc 100755\n--- a/t/t7006-pager.sh\n+++ b/t/t7006-pager.sh\n@@ -7,6 +7,8 @@ test_description='Test automatic use of a pager.'\n . \"$TEST_DIRECTORY\"/lib-terminal.sh\n \n test_expect_success 'setup' '\n+\t: squelch advice messages during the transition &&\n+\tgit config --global log.mailmap false &&\n \tsane_unset GIT_PAGER GIT_PAGER_IN_USE &&\n \ttest_unconfig core.pager &&\n \n-- \n2.17.1\n\n"}]}