{"thread":{"id":"41487","subject":"[PATCH 1/5] Documentation/diff-config: fix description of diff.renames","startedAt":"2016-02-23T17:44:53Z","lastAt":"2016-02-25T19:31:48Z","messageCount":29,"participants":["Matthieu Moy","Junio C Hamano","Jeff King","Felipe Gonçalves Assis"],"isPatch":true,"patchVersion":1,"patchTotal":5},"messages":[{"id":"279043","messageId":"1456249498-3232-1-git-send-email-Matthieu.Moy@imag.fr","threadId":"41487","inReplyTo":null,"subject":"[PATCH 0/5] activate diff.renames by default","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2016-02-23T17:44:53Z","receivedAt":"2016-02-23T17:44:53Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"I have always wondered why diff.renames was not activated by default.\nI've had it to true in my configuration for 9 years, and I've been\nteaching newbies to set it for a while without issue. I think it's\ntime to activate it by default, but please let me know if I missed a\nreason to keep it to false.\n\nIn any case, the first 3 patches are useful cleanups.\n\nMatthieu Moy (5):\n  Documentation/diff-config: fix description of diff.renames\n  t4001-diff-rename: wrap file creations in a test\n  t: add tests for diff.renames (true/false/unset)\n  log: introduce init_log_defaults()\n  diff: activate diff.renames by default\n\n Documentation/diff-config.txt |  7 ++--\n builtin/commit.c              |  1 +\n builtin/diff.c                |  1 +\n builtin/log.c                 | 16 ++++---\n builtin/merge.c               |  1 +\n diff.c                        |  5 +++\n diff.h                        |  1 +\n t/t4001-diff-rename.sh        | 97 +++++++++++++++++++++++++++++++++++--------\n t/t4013-diff-various.sh       |  2 +\n t/t4014-format-patch.sh       |  4 +-\n t/t4047-diff-dirstat.sh       |  3 +-\n t/t4202-log.sh                |  8 ++--\n 12 files changed, 114 insertions(+), 32 deletions(-)\n\n-- \n2.7.2.334.g35ed2ae.dirty\n"},{"id":"279042","messageId":"1456249498-3232-2-git-send-email-Matthieu.Moy@imag.fr","threadId":"41487","inReplyTo":"1456249498-3232-1-git-send-email-Matthieu.Moy@imag.fr","subject":"[PATCH 1/5] Documentation/diff-config: fix description of diff.renames","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2016-02-23T17:44:54Z","receivedAt":"2016-02-23T17:44:54Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"The description was misleading, since \"set to any boolean value\" include\n\"set to false\", and diff.renames=false does not enable basic detection,\nbut actually disables it.\n\nSigned-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n---\n Documentation/diff-config.txt | 7 ++++---\n 1 file changed, 4 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/diff-config.txt b/Documentation/diff-config.txt\nindex 6eaa452..1acd203 100644\n--- a/Documentation/diff-config.txt\n+++ b/Documentation/diff-config.txt\n@@ -108,9 +108,10 @@ diff.renameLimit::\n \tdetection; equivalent to the 'git diff' option '-l'.\n \n diff.renames::\n-\tTells Git to detect renames.  If set to any boolean value, it\n-\twill enable basic rename detection.  If set to \"copies\" or\n-\t\"copy\", it will detect copies, as well.\n+\tWhether and how Git detects renames.  If set to \"false\",\n+\trename detection is disabled. If set to \"true\", basic rename\n+\tdetection is enable.  If set to \"copies\" or \"copy\", Git will\n+\tdetect copies, as well.  Defaults to false.\n \n diff.suppressBlankEmpty::\n \tA boolean to inhibit the standard behavior of printing a space\n-- \n2.7.2.334.g35ed2ae.dirty\n"},{"id":"279047","messageId":"1456249498-3232-3-git-send-email-Matthieu.Moy@imag.fr","threadId":"41487","inReplyTo":"1456249498-3232-1-git-send-email-Matthieu.Moy@imag.fr","subject":"[PATCH 2/5] t4001-diff-rename: wrap file creations in a test","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2016-02-23T17:44:55Z","receivedAt":"2016-02-23T17:44:55Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n---\n t/t4001-diff-rename.sh | 38 +++++++++++++++++++++-----------------\n 1 file changed, 21 insertions(+), 17 deletions(-)\n\ndiff --git a/t/t4001-diff-rename.sh b/t/t4001-diff-rename.sh\nindex 2f327b7..bfb364c 100755\n--- a/t/t4001-diff-rename.sh\n+++ b/t/t4001-diff-rename.sh\n@@ -9,7 +9,9 @@ test_description='Test rename detection in diff engine.\n . ./test-lib.sh\n . \"$TEST_DIRECTORY\"/diff-lib.sh\n \n-echo >path0 'Line 1\n+test_expect_success 'setup' '\n+\tcat >path0 <<\\EOF &&\n+Line 1\n Line 2\n Line 3\n Line 4\n@@ -24,6 +26,23 @@ Line 12\n Line 13\n Line 14\n Line 15\n+EOF\n+\tcat >expected <<\\EOF\n+diff --git a/path0 b/path1\n+rename from path0\n+rename to path1\n+--- a/path0\n++++ b/path1\n+@@ -8,7 +8,7 @@ Line 7\n+ Line 8\n+ Line 9\n+ Line 10\n+-line 11\n++Line 11\n+ Line 12\n+ Line 13\n+ Line 14\n+EOF\n '\n \n test_expect_success \\\n@@ -43,22 +62,7 @@ test_expect_success \\\n test_expect_success \\\n     'git diff-index -p -M after rename and editing.' \\\n     'git diff-index -p -M $tree >current'\n-cat >expected <<\\EOF\n-diff --git a/path0 b/path1\n-rename from path0\n-rename to path1\n---- a/path0\n-+++ b/path1\n-@@ -8,7 +8,7 @@ Line 7\n- Line 8\n- Line 9\n- Line 10\n--line 11\n-+Line 11\n- Line 12\n- Line 13\n- Line 14\n-EOF\n+\n \n test_expect_success \\\n     'validate the output.' \\\n-- \n2.7.2.334.g35ed2ae.dirty\n"},{"id":"279044","messageId":"1456249498-3232-4-git-send-email-Matthieu.Moy@imag.fr","threadId":"41487","inReplyTo":"1456249498-3232-1-git-send-email-Matthieu.Moy@imag.fr","subject":"[PATCH 3/5] t: add tests for diff.renames (true/false/unset)","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2016-02-23T17:44:56Z","receivedAt":"2016-02-23T17:44:56Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"The underlying machinery is well-tested, but the configuration option\nitself was tested only in t3400-rebase.sh.\n\nSigned-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n---\n t/t4001-diff-rename.sh | 61 +++++++++++++++++++++++++++++++++++++++++++++++++-\n 1 file changed, 60 insertions(+), 1 deletion(-)\n\ndiff --git a/t/t4001-diff-rename.sh b/t/t4001-diff-rename.sh\nindex bfb364c..6844906 100755\n--- a/t/t4001-diff-rename.sh\n+++ b/t/t4001-diff-rename.sh\n@@ -27,7 +27,7 @@ Line 13\n Line 14\n Line 15\n EOF\n-\tcat >expected <<\\EOF\n+\tcat >expected <<\\EOF &&\n diff --git a/path0 b/path1\n rename from path0\n rename to path1\n@@ -43,6 +43,50 @@ rename to path1\n  Line 13\n  Line 14\n EOF\n+\tcat >no-rename <<\\EOF\n+diff --git a/path0 b/path0\n+deleted file mode 100644\n+index fdbec44..0000000\n+--- a/path0\n++++ /dev/null\n+@@ -1,15 +0,0 @@\n+-Line 1\n+-Line 2\n+-Line 3\n+-Line 4\n+-Line 5\n+-Line 6\n+-Line 7\n+-Line 8\n+-Line 9\n+-Line 10\n+-line 11\n+-Line 12\n+-Line 13\n+-Line 14\n+-Line 15\n+diff --git a/path1 b/path1\n+new file mode 100644\n+index 0000000..752c50e\n+--- /dev/null\n++++ b/path1\n+@@ -0,0 +1,15 @@\n++Line 1\n++Line 2\n++Line 3\n++Line 4\n++Line 5\n++Line 6\n++Line 7\n++Line 8\n++Line 9\n++Line 10\n++Line 11\n++Line 12\n++Line 13\n++Line 14\n++Line 15\n+EOF\n '\n \n test_expect_success \\\n@@ -68,6 +112,21 @@ test_expect_success \\\n     'validate the output.' \\\n     'compare_diff_patch current expected'\n \n+test_expect_success 'test diff.renames=true' '\n+\tgit -c diff.renames=true diff --cached $tree >current &&\n+\tcompare_diff_patch current expected\n+'\n+\n+test_expect_success 'test diff.renames=false' '\n+\tgit -c diff.renames=false diff --cached $tree >current &&\n+\tcompare_diff_patch current no-rename\n+'\n+\n+test_expect_success 'test diff.renames unset' '\n+\tgit diff --cached $tree >current &&\n+\tcompare_diff_patch current no-rename\n+'\n+\n test_expect_success 'favour same basenames over different ones' '\n \tcp path1 another-path &&\n \tgit add another-path &&\n-- \n2.7.2.334.g35ed2ae.dirty\n"},{"id":"279045","messageId":"1456249498-3232-5-git-send-email-Matthieu.Moy@imag.fr","threadId":"41487","inReplyTo":"1456249498-3232-1-git-send-email-Matthieu.Moy@imag.fr","subject":"[PATCH 4/5] log: introduce init_log_defaults()","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2016-02-23T17:44:57Z","receivedAt":"2016-02-23T17:44:57Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"This is currently a wrapper around init_grep_defaults(), but will allow\nadding more initialization in further patches.\n\nSigned-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n---\n builtin/log.c | 15 ++++++++++-----\n 1 file changed, 10 insertions(+), 5 deletions(-)\n\ndiff --git a/builtin/log.c b/builtin/log.c\nindex 0d738d6..7f96c64 100644\n--- a/builtin/log.c\n+++ b/builtin/log.c\n@@ -100,6 +100,11 @@ static int log_line_range_callback(const struct option *option, const char *arg,\n \treturn 0;\n }\n \n+static void init_log_defaults()\n+{\n+\tinit_grep_defaults();\n+}\n+\n static void cmd_log_init_defaults(struct rev_info *rev)\n {\n \tif (fmt_pretty)\n@@ -416,7 +421,7 @@ int cmd_whatchanged(int argc, const char **argv, const char *prefix)\n \tstruct rev_info rev;\n \tstruct setup_revision_opt opt;\n \n-\tinit_grep_defaults();\n+\tinit_log_defaults();\n \tgit_config(git_log_config, NULL);\n \n \tinit_revisions(&rev, prefix);\n@@ -527,7 +532,7 @@ int cmd_show(int argc, const char **argv, const char *prefix)\n \tstruct pathspec match_all;\n \tint i, count, ret = 0;\n \n-\tinit_grep_defaults();\n+\tinit_log_defaults();\n \tgit_config(git_log_config, NULL);\n \n \tmemset(&match_all, 0, sizeof(match_all));\n@@ -608,7 +613,7 @@ int cmd_log_reflog(int argc, const char **argv, const char *prefix)\n \tstruct rev_info rev;\n \tstruct setup_revision_opt opt;\n \n-\tinit_grep_defaults();\n+\tinit_log_defaults();\n \tgit_config(git_log_config, NULL);\n \n \tinit_revisions(&rev, prefix);\n@@ -647,7 +652,7 @@ int cmd_log(int argc, const char **argv, const char *prefix)\n \tstruct rev_info rev;\n \tstruct setup_revision_opt opt;\n \n-\tinit_grep_defaults();\n+\tinit_log_defaults();\n \tgit_config(git_log_config, NULL);\n \n \tinit_revisions(&rev, prefix);\n@@ -1280,7 +1285,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)\n \textra_hdr.strdup_strings = 1;\n \textra_to.strdup_strings = 1;\n \textra_cc.strdup_strings = 1;\n-\tinit_grep_defaults();\n+\tinit_log_defaults();\n \tgit_config(git_format_config, NULL);\n \tinit_revisions(&rev, prefix);\n \trev.commit_format = CMIT_FMT_EMAIL;\n-- \n2.7.2.334.g35ed2ae.dirty\n"},{"id":"279046","messageId":"1456249498-3232-6-git-send-email-Matthieu.Moy@imag.fr","threadId":"41487","inReplyTo":"1456249498-3232-1-git-send-email-Matthieu.Moy@imag.fr","subject":"[PATCH 5/5] diff: activate diff.renames by default","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2016-02-23T17:44:58Z","receivedAt":"2016-02-23T17:44:58Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Rename detection is a very convenient feature, and new users shouldn't\nhave to dig in the documentation to benefit from it.\n\nPotential objections to activating rename detection are that it\nsometimes fail, and it is sometimes slow. But rename detection is\nalready activated by default in several cases like \"git status\" and \"git\nmerge\", so activating diff.renames does not fundamentally change the\nsituation. When the rename detection fails, it now fails consistently\nbetween \"git diff\" and \"git status\".\n\nThis setting does not affect plumbing commands, hence well-written\nscripts will not be affected.\n\nSigned-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n---\n Documentation/diff-config.txt | 2 +-\n builtin/commit.c              | 1 +\n builtin/diff.c                | 1 +\n builtin/log.c                 | 1 +\n builtin/merge.c               | 1 +\n diff.c                        | 5 +++++\n diff.h                        | 1 +\n t/t4001-diff-rename.sh        | 2 +-\n t/t4013-diff-various.sh       | 2 ++\n t/t4014-format-patch.sh       | 4 ++--\n t/t4047-diff-dirstat.sh       | 3 ++-\n t/t4202-log.sh                | 8 ++++----\n 12 files changed, 22 insertions(+), 9 deletions(-)\n\ndiff --git a/Documentation/diff-config.txt b/Documentation/diff-config.txt\nindex 1acd203..fdf5a79 100644\n--- a/Documentation/diff-config.txt\n+++ b/Documentation/diff-config.txt\n@@ -111,7 +111,7 @@ diff.renames::\n \tWhether and how Git detects renames.  If set to \"false\",\n \trename detection is disabled. If set to \"true\", basic rename\n \tdetection is enable.  If set to \"copies\" or \"copy\", Git will\n-\tdetect copies, as well.  Defaults to false.\n+\tdetect copies, as well.  Defaults to true.\n \n diff.suppressBlankEmpty::\n \tA boolean to inhibit the standard behavior of printing a space\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex b3bd2d4..3cb4843 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -186,6 +186,7 @@ static void status_init_config(struct wt_status *s, config_fn_t fn)\n \tgitmodules_config();\n \tgit_config(fn, s);\n \tdetermine_whence(s);\n+\tgit_diff_ui_default_config();\n \ts->hints = advice_status_hints; /* must come after git_config() */\n }\n \ndiff --git a/builtin/diff.c b/builtin/diff.c\nindex 52c98a9..8bd1fd5 100644\n--- a/builtin/diff.c\n+++ b/builtin/diff.c\n@@ -318,6 +318,7 @@ int cmd_diff(int argc, const char **argv, const char *prefix)\n \n \tif (!no_index)\n \t\tgitmodules_config();\n+\tgit_diff_ui_default_config();\n \tgit_config(git_diff_ui_config, NULL);\n \n \tinit_revisions(&rev, prefix);\ndiff --git a/builtin/log.c b/builtin/log.c\nindex 7f96c64..6e34df3 100644\n--- a/builtin/log.c\n+++ b/builtin/log.c\n@@ -103,6 +103,7 @@ static int log_line_range_callback(const struct option *option, const char *arg,\n static void init_log_defaults()\n {\n \tinit_grep_defaults();\n+\tgit_diff_ui_default_config();\n }\n \n static void cmd_log_init_defaults(struct rev_info *rev)\ndiff --git a/builtin/merge.c b/builtin/merge.c\nindex b98a348..cf297d4 100644\n--- a/builtin/merge.c\n+++ b/builtin/merge.c\n@@ -1187,6 +1187,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)\n \telse\n \t\thead_commit = lookup_commit_or_die(head_sha1, \"HEAD\");\n \n+\tgit_diff_ui_default_config();\n \tgit_config(git_merge_config, NULL);\n \n \tif (branch_mergeoptions)\ndiff --git a/diff.c b/diff.c\nindex 2136b69..d5db898 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -168,6 +168,11 @@ long parse_algorithm_value(const char *value)\n  * never be affected by the setting of diff.renames\n  * the user happens to have in the configuration file.\n  */\n+void git_diff_ui_default_config()\n+{\n+\tdiff_detect_rename_default = 1;\n+}\n+\n int git_diff_ui_config(const char *var, const char *value, void *cb)\n {\n \tif (!strcmp(var, \"diff.color\") || !strcmp(var, \"color.diff\")) {\ndiff --git a/diff.h b/diff.h\nindex 70b2d70..75686d5 100644\n--- a/diff.h\n+++ b/diff.h\n@@ -266,6 +266,7 @@ extern int parse_long_opt(const char *opt, const char **argv,\n \t\t\t const char **optarg);\n \n extern int git_diff_basic_config(const char *var, const char *value, void *cb);\n+extern void git_diff_ui_default_config();\n extern int git_diff_ui_config(const char *var, const char *value, void *cb);\n extern void diff_setup(struct diff_options *);\n extern int diff_opt_parse(struct diff_options *, const char **, int, const char *);\ndiff --git a/t/t4001-diff-rename.sh b/t/t4001-diff-rename.sh\nindex 6844906..15d99a3 100755\n--- a/t/t4001-diff-rename.sh\n+++ b/t/t4001-diff-rename.sh\n@@ -124,7 +124,7 @@ test_expect_success 'test diff.renames=false' '\n \n test_expect_success 'test diff.renames unset' '\n \tgit diff --cached $tree >current &&\n-\tcompare_diff_patch current no-rename\n+\tcompare_diff_patch current expected\n '\n \n test_expect_success 'favour same basenames over different ones' '\ndiff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh\nindex 6ec6072..94ef500 100755\n--- a/t/t4013-diff-various.sh\n+++ b/t/t4013-diff-various.sh\n@@ -90,6 +90,8 @@ test_expect_success setup '\n \tgit commit -m \"Rearranged lines in dir/sub\" &&\n \tgit checkout master &&\n \n+\tgit config diff.renames false &&\n+\n \tgit show-branch\n '\n \ndiff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh\nindex 3b99434..eed2981 100755\n--- a/t/t4014-format-patch.sh\n+++ b/t/t4014-format-patch.sh\n@@ -549,7 +549,7 @@ test_expect_success 'cover-letter inherits diff options' '\n \n \tgit mv file foo &&\n \tgit commit -m foo &&\n-\tgit format-patch --cover-letter -1 &&\n+\tgit format-patch --no-renames --cover-letter -1 &&\n \tcheck_patch 0000-cover-letter.patch &&\n \t! grep \"file => foo .* 0 *\\$\" 0000-cover-letter.patch &&\n \tgit format-patch --cover-letter -1 -M &&\n@@ -703,7 +703,7 @@ test_expect_success 'options no longer allowed for format-patch' '\n \n test_expect_success 'format-patch --numstat should produce a patch' '\n \tgit format-patch --numstat --stdout master..side > output &&\n-\ttest 6 = $(grep \"^diff --git a/\" output | wc -l)'\n+\ttest 5 = $(grep \"^diff --git a/\" output | wc -l)'\n \n test_expect_success 'format-patch -- <path>' '\n \tgit format-patch master..side -- file 2>error &&\ndiff --git a/t/t4047-diff-dirstat.sh b/t/t4047-diff-dirstat.sh\nindex 3b8b792..447a8ff 100755\n--- a/t/t4047-diff-dirstat.sh\n+++ b/t/t4047-diff-dirstat.sh\n@@ -248,7 +248,8 @@ EOF\n \tgit rm -r src/move/unchanged &&\n \tgit rm -r src/move/changed &&\n \tgit rm -r src/move/rearranged &&\n-\tgit commit -m \"changes\"\n+\tgit commit -m \"changes\" &&\n+\tgit config diff.renames false\n '\n \n cat <<EOF >expect_diff_stat\ndiff --git a/t/t4202-log.sh b/t/t4202-log.sh\nindex cb82eb7..128ba93 100755\n--- a/t/t4202-log.sh\n+++ b/t/t4202-log.sh\n@@ -101,8 +101,8 @@ test_expect_success 'oneline' '\n \n test_expect_success 'diff-filter=A' '\n \n-\tgit log --pretty=\"format:%s\" --diff-filter=A HEAD > actual &&\n-\tgit log --pretty=\"format:%s\" --diff-filter A HEAD > actual-separate &&\n+\tgit log --no-renames --pretty=\"format:%s\" --diff-filter=A HEAD > actual &&\n+\tgit log --no-renames --pretty=\"format:%s\" --diff-filter A HEAD > actual-separate &&\n \tprintf \"fifth\\nfourth\\nthird\\ninitial\" > expect &&\n \ttest_cmp expect actual &&\n \ttest_cmp expect actual-separate\n@@ -119,7 +119,7 @@ test_expect_success 'diff-filter=M' '\n \n test_expect_success 'diff-filter=D' '\n \n-\tactual=$(git log --pretty=\"format:%s\" --diff-filter=D HEAD) &&\n+\tactual=$(git log --no-renames --pretty=\"format:%s\" --diff-filter=D HEAD) &&\n \texpect=$(echo sixth ; echo third) &&\n \tverbose test \"$actual\" = \"$expect\"\n \n@@ -848,7 +848,7 @@ sanitize_output () {\n }\n \n test_expect_success 'log --graph with diff and stats' '\n-\tgit log --graph --pretty=short --stat -p >actual &&\n+\tgit log --no-renames --graph --pretty=short --stat -p >actual &&\n \tsanitize_output >actual.sanitized <actual &&\n \ttest_i18ncmp expect actual.sanitized\n '\n-- \n2.7.2.334.g35ed2ae.dirty\n"},{"id":"279054","messageId":"xmqqa8mr1bk7.fsf@gitster.mtv.corp.google.com","threadId":"41487","inReplyTo":"1456249498-3232-1-git-send-email-Matthieu.Moy@imag.fr","subject":"Re: [PATCH 0/5] activate diff.renames by default","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-02-23T19:17:12Z","receivedAt":"2016-02-23T19:17:12Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthieu Moy <Matthieu.Moy@imag.fr> writes:\n\n> I have always wondered why diff.renames was not activated by default.\n> I've had it to true in my configuration for 9 years, and I've been\n> teaching newbies to set it for a while without issue. I think it's\n> time to activate it by default, but please let me know if I missed a\n> reason to keep it to false.\n>\n> In any case, the first 3 patches are useful cleanups.\n\nIt's a long time coming since I heard \"I love how I can just say\n'oh, keep in mind that we might want to..' and 24 hours later you\ndid it.\" [*1*]\n\nI can hardly be an impartial judge for this series, though.\n\n[Reference]\n\n*1* http://thread.gmane.org/gmane.comp.version-control.git/3541/focus=3702\n\n> Matthieu Moy (5):\n>   Documentation/diff-config: fix description of diff.renames\n>   t4001-diff-rename: wrap file creations in a test\n>   t: add tests for diff.renames (true/false/unset)\n>   log: introduce init_log_defaults()\n>   diff: activate diff.renames by default\n>\n>  Documentation/diff-config.txt |  7 ++--\n>  builtin/commit.c              |  1 +\n>  builtin/diff.c                |  1 +\n>  builtin/log.c                 | 16 ++++---\n>  builtin/merge.c               |  1 +\n>  diff.c                        |  5 +++\n>  diff.h                        |  1 +\n>  t/t4001-diff-rename.sh        | 97 +++++++++++++++++++++++++++++++++++--------\n>  t/t4013-diff-various.sh       |  2 +\n>  t/t4014-format-patch.sh       |  4 +-\n>  t/t4047-diff-dirstat.sh       |  3 +-\n>  t/t4202-log.sh                |  8 ++--\n>  12 files changed, 114 insertions(+), 32 deletions(-)\n"},{"id":"279063","messageId":"vpqsi0jf94g.fsf@anie.imag.fr","threadId":"41487","inReplyTo":"xmqqa8mr1bk7.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH 0/5] activate diff.renames by default","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2016-02-23T20:46:07Z","receivedAt":"2016-02-23T20:46:07Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Matthieu Moy <Matthieu.Moy@imag.fr> writes:\n>\n>> I have always wondered why diff.renames was not activated by default.\n>> I've had it to true in my configuration for 9 years, and I've been\n>> teaching newbies to set it for a while without issue. I think it's\n>> time to activate it by default, but please let me know if I missed a\n>> reason to keep it to false.\n>>\n>> In any case, the first 3 patches are useful cleanups.\n>\n> It's a long time coming since I heard \"I love how I can just say\n> 'oh, keep in mind that we might want to..' and 24 hours later you\n> did it.\" [*1*]\n>\n> I can hardly be an impartial judge for this series, though.\n>\n> [Reference]\n>\n> *1* http://thread.gmane.org/gmane.comp.version-control.git/3541/focus=3702\n\nI guess there's another reference needed to fully understand your\nmessage, and I'm not sure I have it right. Are you refering to the\n\"merge-recursive: test rename threshold option\" discussion?\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"279068","messageId":"xmqqk2lvywch.fsf@gitster.mtv.corp.google.com","threadId":"41487","inReplyTo":"1456249498-3232-6-git-send-email-Matthieu.Moy@imag.fr","subject":"Re: [PATCH 5/5] diff: activate diff.renames by default","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-02-23T21:01:50Z","receivedAt":"2016-02-23T21:01:50Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthieu Moy <Matthieu.Moy@imag.fr> writes:\n\n> diff --git a/builtin/log.c b/builtin/log.c\n> index 7f96c64..6e34df3 100644\n> --- a/builtin/log.c\n> +++ b/builtin/log.c\n> @@ -103,6 +103,7 @@ static int log_line_range_callback(const struct option *option, const char *arg,\n>  static void init_log_defaults()\n>  {\n>  \tinit_grep_defaults();\n> +\tgit_diff_ui_default_config();\n>  }\n\nWhy isn't the new function called init_diff_ui_defaults()?\n\n> diff --git a/diff.c b/diff.c\n> index 2136b69..d5db898 100644\n> --- a/diff.c\n> +++ b/diff.c\n> @@ -168,6 +168,11 @@ long parse_algorithm_value(const char *value)\n>   * never be affected by the setting of diff.renames\n>   * the user happens to have in the configuration file.\n>   */\n> +void git_diff_ui_default_config()\n\ns/()/(void)/;  same for the declaration in the header file.\n"},{"id":"279076","messageId":"vpq60xff7yo.fsf@anie.imag.fr","threadId":"41487","inReplyTo":"xmqqk2lvywch.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH 5/5] diff: activate diff.renames by default","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2016-02-23T21:11:11Z","receivedAt":"2016-02-23T21:11:11Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Matthieu Moy <Matthieu.Moy@imag.fr> writes:\n>\n>> diff --git a/builtin/log.c b/builtin/log.c\n>> index 7f96c64..6e34df3 100644\n>> --- a/builtin/log.c\n>> +++ b/builtin/log.c\n>> @@ -103,6 +103,7 @@ static int log_line_range_callback(const struct option *option, const char *arg,\n>>  static void init_log_defaults()\n>>  {\n>>  \tinit_grep_defaults();\n>> +\tgit_diff_ui_default_config();\n>>  }\n>\n> Why isn't the new function called init_diff_ui_defaults()?\n\nIndeed, that's a better name. I changed it.\n\n>> diff --git a/diff.c b/diff.c\n>> index 2136b69..d5db898 100644\n>> --- a/diff.c\n>> +++ b/diff.c\n>> @@ -168,6 +168,11 @@ long parse_algorithm_value(const char *value)\n>>   * never be affected by the setting of diff.renames\n>>   * the user happens to have in the configuration file.\n>>   */\n>> +void git_diff_ui_default_config()\n>\n> s/()/(void)/;  same for the declaration in the header file.\n\nFixed. 'doing too much C++ and not enough C ;-).\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"279080","messageId":"xmqqsi0jxfz8.fsf@gitster.mtv.corp.google.com","threadId":"41487","inReplyTo":"vpqsi0jf94g.fsf@anie.imag.fr","subject":"Re: [PATCH 0/5] activate diff.renames by default","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-02-23T21:40:43Z","receivedAt":"2016-02-23T21:40:43Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:\n\n> Junio C Hamano <gitster@pobox.com> writes:\n>\n>> Matthieu Moy <Matthieu.Moy@imag.fr> writes:\n>>\n>>> I have always wondered why diff.renames was not activated by default.\n>>> I've had it to true in my configuration for 9 years, and I've been\n>>> teaching newbies to set it for a while without issue. I think it's\n>>> time to activate it by default, but please let me know if I missed a\n>>> reason to keep it to false.\n>>>\n>>> In any case, the first 3 patches are useful cleanups.\n>>\n>> It's a long time coming since I heard \"I love how I can just say\n>> 'oh, keep in mind that we might want to..' and 24 hours later you\n>> did it.\" [*1*]\n>>\n>> I can hardly be an impartial judge for this series, though.\n>>\n>> [Reference]\n>>\n>> *1* http://thread.gmane.org/gmane.comp.version-control.git/3541/focus=3702\n>\n> I guess there's another reference needed to fully understand your\n> message, and I'm not sure I have it right. Are you refering to the\n> \"merge-recursive: test rename threshold option\" discussion?\n\nNot at all.\n\nI was just mentioning that it would at last be a major achievement,\nif this can safely turned on by default for everybody, after having\ninvented the machinery and the feature looooong time ago ;-)\n"},{"id":"279141","messageId":"20160224102510.GB21152@sigill.intra.peff.net","threadId":"41487","inReplyTo":"1456249498-3232-3-git-send-email-Matthieu.Moy@imag.fr","subject":"Re: [PATCH 2/5] t4001-diff-rename: wrap file creations in a test","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-02-24T10:25:10Z","receivedAt":"2016-02-24T10:25:10Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Feb 23, 2016 at 06:44:55PM +0100, Matthieu Moy wrote:\n\n> Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n> ---\n>  t/t4001-diff-rename.sh | 38 +++++++++++++++++++++-----------------\n>  1 file changed, 21 insertions(+), 17 deletions(-)\n> \n> diff --git a/t/t4001-diff-rename.sh b/t/t4001-diff-rename.sh\n> index 2f327b7..bfb364c 100755\n> --- a/t/t4001-diff-rename.sh\n> +++ b/t/t4001-diff-rename.sh\n> @@ -9,7 +9,9 @@ test_description='Test rename detection in diff engine.\n>  . ./test-lib.sh\n>  . \"$TEST_DIRECTORY\"/diff-lib.sh\n>  \n> -echo >path0 'Line 1\n> +test_expect_success 'setup' '\n> +\tcat >path0 <<\\EOF &&\n> +Line 1\n>  Line 2\n>  Line 3\n>  Line 4\n\nShould we use \"<<-\" here (and elsewhere) to indent the sample lines? It\nmakes your diff bigger, but I think the end result is much easier to\nread.\n\n-Peff\n"},{"id":"279142","messageId":"20160224102729.GC21152@sigill.intra.peff.net","threadId":"41487","inReplyTo":"1456249498-3232-2-git-send-email-Matthieu.Moy@imag.fr","subject":"Re: [PATCH 1/5] Documentation/diff-config: fix description of diff.renames","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-02-24T10:27:29Z","receivedAt":"2016-02-24T10:27:29Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Feb 23, 2016 at 06:44:54PM +0100, Matthieu Moy wrote:\n\n> The description was misleading, since \"set to any boolean value\" include\n> \"set to false\", and diff.renames=false does not enable basic detection,\n> but actually disables it.\n> \n> Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n> ---\n>  Documentation/diff-config.txt | 7 ++++---\n>  1 file changed, 4 insertions(+), 3 deletions(-)\n> \n> diff --git a/Documentation/diff-config.txt b/Documentation/diff-config.txt\n> index 6eaa452..1acd203 100644\n> --- a/Documentation/diff-config.txt\n> +++ b/Documentation/diff-config.txt\n> @@ -108,9 +108,10 @@ diff.renameLimit::\n>  \tdetection; equivalent to the 'git diff' option '-l'.\n>  \n>  diff.renames::\n> -\tTells Git to detect renames.  If set to any boolean value, it\n> -\twill enable basic rename detection.  If set to \"copies\" or\n> -\t\"copy\", it will detect copies, as well.\n> +\tWhether and how Git detects renames.  If set to \"false\",\n> +\trename detection is disabled. If set to \"true\", basic rename\n> +\tdetection is enable.  If set to \"copies\" or \"copy\", Git will\n> +\tdetect copies, as well.  Defaults to false.\n\nLooks OK to me. I thought we had \"copies-harder\" or something, but I\ndouble-checked and we don't. I doubt anybody would want to set it\nanyway, as it can be quite expensive.\n\n-Peff\n"},{"id":"279145","messageId":"20160224104203.GD21152@sigill.intra.peff.net","threadId":"41487","inReplyTo":"1456249498-3232-6-git-send-email-Matthieu.Moy@imag.fr","subject":"Re: [PATCH 5/5] diff: activate diff.renames by default","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-02-24T10:42:04Z","receivedAt":"2016-02-24T10:42:04Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Feb 23, 2016 at 06:44:58PM +0100, Matthieu Moy wrote:\n\n> diff --git a/Documentation/diff-config.txt b/Documentation/diff-config.txt\n> index 1acd203..fdf5a79 100644\n> --- a/Documentation/diff-config.txt\n> +++ b/Documentation/diff-config.txt\n> @@ -111,7 +111,7 @@ diff.renames::\n>  \tWhether and how Git detects renames.  If set to \"false\",\n>  \trename detection is disabled. If set to \"true\", basic rename\n>  \tdetection is enable.  If set to \"copies\" or \"copy\", Git will\n> -\tdetect copies, as well.  Defaults to false.\n> +\tdetect copies, as well.  Defaults to true.\n\nI wonder if we need to talk about plumbing versus porcelain here, as it\ndoes not default to true for diff-tree, for example. But I guess that is\nalready the case (even setting it to true yourself does not affect\ndiff-tree).\n\n-Peff\n"},{"id":"279156","messageId":"vpq7fhu8d0t.fsf@anie.imag.fr","threadId":"41487","inReplyTo":"20160224102510.GB21152@sigill.intra.peff.net","subject":"Re: [PATCH 2/5] t4001-diff-rename: wrap file creations in a test","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2016-02-24T13:16:02Z","receivedAt":"2016-02-24T13:16:02Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Jeff King <peff@peff.net> writes:\n\n> On Tue, Feb 23, 2016 at 06:44:55PM +0100, Matthieu Moy wrote:\n>\n>> Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n>> ---\n>>  t/t4001-diff-rename.sh | 38 +++++++++++++++++++++-----------------\n>>  1 file changed, 21 insertions(+), 17 deletions(-)\n>> \n>> diff --git a/t/t4001-diff-rename.sh b/t/t4001-diff-rename.sh\n>> index 2f327b7..bfb364c 100755\n>> --- a/t/t4001-diff-rename.sh\n>> +++ b/t/t4001-diff-rename.sh\n>> @@ -9,7 +9,9 @@ test_description='Test rename detection in diff engine.\n>>  . ./test-lib.sh\n>>  . \"$TEST_DIRECTORY\"/diff-lib.sh\n>>  \n>> -echo >path0 'Line 1\n>> +test_expect_success 'setup' '\n>> +\tcat >path0 <<\\EOF &&\n>> +Line 1\n>>  Line 2\n>>  Line 3\n>>  Line 4\n>\n> Should we use \"<<-\" here (and elsewhere) to indent the sample lines?\n\nI did not use it because I thought it would strip the leading space\n(' '), but actually it strips only tabs so we can definitely use it.\n\nI changed it to <<- and pushed it here:\nhttps://github.com/moy/git/commits/set-diff-renames\n\nI'll resend later.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"279294","messageId":"vpqwppt5fwr.fsf@anie.imag.fr","threadId":"41487","inReplyTo":"20160224104203.GD21152@sigill.intra.peff.net","subject":"Re: [PATCH 5/5] diff: activate diff.renames by default","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2016-02-25T08:54:12Z","receivedAt":"2016-02-25T08:54:12Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Jeff King <peff@peff.net> writes:\n\n> On Tue, Feb 23, 2016 at 06:44:58PM +0100, Matthieu Moy wrote:\n>\n>> diff --git a/Documentation/diff-config.txt b/Documentation/diff-config.txt\n>> index 1acd203..fdf5a79 100644\n>> --- a/Documentation/diff-config.txt\n>> +++ b/Documentation/diff-config.txt\n>> @@ -111,7 +111,7 @@ diff.renames::\n>>  \tWhether and how Git detects renames.  If set to \"false\",\n>>  \trename detection is disabled. If set to \"true\", basic rename\n>>  \tdetection is enable.  If set to \"copies\" or \"copy\", Git will\n>> -\tdetect copies, as well.  Defaults to false.\n>> +\tdetect copies, as well.  Defaults to true.\n>\n> I wonder if we need to talk about plumbing versus porcelain here, as it\n> does not default to true for diff-tree, for example. But I guess that is\n> already the case (even setting it to true yourself does not affect\n> diff-tree).\n\nYes, it was already the case. But it doesn't harm to document it while\nwe're there. I've added this in v2:\n\n        Note that this\n\taffects only 'git diff' Porcelain like linkgit:git-diff[1] and\n\tlinkgit:git-log[1], and not lower level commands such as\n\tlinkgit:git-diff-files[1].\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"279295","messageId":"1456390761-27015-1-git-send-email-Matthieu.Moy@imag.fr","threadId":"41487","inReplyTo":"1456249498-3232-1-git-send-email-Matthieu.Moy@imag.fr","subject":"[PATCH v2 0/5] activate diff.renames by default","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2016-02-25T08:59:16Z","receivedAt":"2016-02-25T08:59:16Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Remarks on v1 applied:\n\n* document that diff.renames applies only to porcelain\n\n* use <<- instead of << in tests\n\n* rename git_diff_ui_default_config to init_diff_ui_defaults\n\n* f() -> f(void)\n\nInterdiff follows:\n\ndiff --git a/Documentation/diff-config.txt b/Documentation/diff-config.txt\nindex fdf5a79..69389ae 100644\n--- a/Documentation/diff-config.txt\n+++ b/Documentation/diff-config.txt\n@@ -111,7 +111,10 @@ diff.renames::\n \tWhether and how Git detects renames.  If set to \"false\",\n \trename detection is disabled. If set to \"true\", basic rename\n \tdetection is enable.  If set to \"copies\" or \"copy\", Git will\n-\tdetect copies, as well.  Defaults to true.\n+\tdetect copies, as well.  Defaults to true.  Note that this\n+\taffects only 'git diff' Porcelain like linkgit:git-diff[1] and\n+\tlinkgit:git-log[1], and not lower level commands such as\n+\tlinkgit:git-diff-files[1].\n \n diff.suppressBlankEmpty::\n \tA boolean to inhibit the standard behavior of printing a space\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex 3cb4843..109742e 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -186,7 +186,7 @@ static void status_init_config(struct wt_status *s, config_fn_t fn)\n \tgitmodules_config();\n \tgit_config(fn, s);\n \tdetermine_whence(s);\n-\tgit_diff_ui_default_config();\n+\tinit_diff_ui_defaults();\n \ts->hints = advice_status_hints; /* must come after git_config() */\n }\n \ndiff --git a/builtin/diff.c b/builtin/diff.c\nindex 8bd1fd5..343c6b8 100644\n--- a/builtin/diff.c\n+++ b/builtin/diff.c\n@@ -318,7 +318,7 @@ int cmd_diff(int argc, const char **argv, const char *prefix)\n \n \tif (!no_index)\n \t\tgitmodules_config();\n-\tgit_diff_ui_default_config();\n+\tinit_diff_ui_defaults();\n \tgit_config(git_diff_ui_config, NULL);\n \n \tinit_revisions(&rev, prefix);\ndiff --git a/builtin/log.c b/builtin/log.c\nindex 6e34df3..c05a5f6 100644\n--- a/builtin/log.c\n+++ b/builtin/log.c\n@@ -103,7 +103,7 @@ static int log_line_range_callback(const struct option *option, const char *arg,\n static void init_log_defaults()\n {\n \tinit_grep_defaults();\n-\tgit_diff_ui_default_config();\n+\tinit_diff_ui_defaults();\n }\n \n static void cmd_log_init_defaults(struct rev_info *rev)\ndiff --git a/builtin/merge.c b/builtin/merge.c\nindex cf297d4..4cb4f6a 100644\n--- a/builtin/merge.c\n+++ b/builtin/merge.c\n@@ -1187,7 +1187,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)\n \telse\n \t\thead_commit = lookup_commit_or_die(head_sha1, \"HEAD\");\n \n-\tgit_diff_ui_default_config();\n+\tinit_diff_ui_defaults();\n \tgit_config(git_merge_config, NULL);\n \n \tif (branch_mergeoptions)\ndiff --git a/diff.c b/diff.c\nindex d5db898..b4dea07 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -168,7 +168,7 @@ long parse_algorithm_value(const char *value)\n  * never be affected by the setting of diff.renames\n  * the user happens to have in the configuration file.\n  */\n-void git_diff_ui_default_config()\n+void init_diff_ui_defaults(void)\n {\n \tdiff_detect_rename_default = 1;\n }\ndiff --git a/diff.h b/diff.h\nindex 75686d5..0a3ce86 100644\n--- a/diff.h\n+++ b/diff.h\n@@ -266,7 +266,7 @@ extern int parse_long_opt(const char *opt, const char **argv,\n \t\t\t const char **optarg);\n \n extern int git_diff_basic_config(const char *var, const char *value, void *cb);\n-extern void git_diff_ui_default_config();\n+extern void init_diff_ui_defaults(void);\n extern int git_diff_ui_config(const char *var, const char *value, void *cb);\n extern void diff_setup(struct diff_options *);\n extern int diff_opt_parse(struct diff_options *, const char **, int, const char *);\ndiff --git a/t/t4001-diff-rename.sh b/t/t4001-diff-rename.sh\nindex 15d99a3..c7e58b6 100755\n--- a/t/t4001-diff-rename.sh\n+++ b/t/t4001-diff-rename.sh\n@@ -10,83 +10,83 @@ test_description='Test rename detection in diff engine.\n . \"$TEST_DIRECTORY\"/diff-lib.sh\n \n test_expect_success 'setup' '\n-\tcat >path0 <<\\EOF &&\n-Line 1\n-Line 2\n-Line 3\n-Line 4\n-Line 5\n-Line 6\n-Line 7\n-Line 8\n-Line 9\n-Line 10\n-line 11\n-Line 12\n-Line 13\n-Line 14\n-Line 15\n-EOF\n-\tcat >expected <<\\EOF &&\n-diff --git a/path0 b/path1\n-rename from path0\n-rename to path1\n---- a/path0\n-+++ b/path1\n-@@ -8,7 +8,7 @@ Line 7\n- Line 8\n- Line 9\n- Line 10\n--line 11\n-+Line 11\n- Line 12\n- Line 13\n- Line 14\n-EOF\n-\tcat >no-rename <<\\EOF\n-diff --git a/path0 b/path0\n-deleted file mode 100644\n-index fdbec44..0000000\n---- a/path0\n-+++ /dev/null\n-@@ -1,15 +0,0 @@\n--Line 1\n--Line 2\n--Line 3\n--Line 4\n--Line 5\n--Line 6\n--Line 7\n--Line 8\n--Line 9\n--Line 10\n--line 11\n--Line 12\n--Line 13\n--Line 14\n--Line 15\n-diff --git a/path1 b/path1\n-new file mode 100644\n-index 0000000..752c50e\n---- /dev/null\n-+++ b/path1\n-@@ -0,0 +1,15 @@\n-+Line 1\n-+Line 2\n-+Line 3\n-+Line 4\n-+Line 5\n-+Line 6\n-+Line 7\n-+Line 8\n-+Line 9\n-+Line 10\n-+Line 11\n-+Line 12\n-+Line 13\n-+Line 14\n-+Line 15\n-EOF\n+\tcat >path0 <<-\\EOF &&\n+\tLine 1\n+\tLine 2\n+\tLine 3\n+\tLine 4\n+\tLine 5\n+\tLine 6\n+\tLine 7\n+\tLine 8\n+\tLine 9\n+\tLine 10\n+\tline 11\n+\tLine 12\n+\tLine 13\n+\tLine 14\n+\tLine 15\n+\tEOF\n+\tcat >expected <<-\\EOF &&\n+\tdiff --git a/path0 b/path1\n+\trename from path0\n+\trename to path1\n+\t--- a/path0\n+\t+++ b/path1\n+\t@@ -8,7 +8,7 @@ Line 7\n+\t Line 8\n+\t Line 9\n+\t Line 10\n+\t-line 11\n+\t+Line 11\n+\t Line 12\n+\t Line 13\n+\t Line 14\n+\tEOF\n+\tcat >no-rename <<-\\EOF\n+\tdiff --git a/path0 b/path0\n+\tdeleted file mode 100644\n+\tindex fdbec44..0000000\n+\t--- a/path0\n+\t+++ /dev/null\n+\t@@ -1,15 +0,0 @@\n+\t-Line 1\n+\t-Line 2\n+\t-Line 3\n+\t-Line 4\n+\t-Line 5\n+\t-Line 6\n+\t-Line 7\n+\t-Line 8\n+\t-Line 9\n+\t-Line 10\n+\t-line 11\n+\t-Line 12\n+\t-Line 13\n+\t-Line 14\n+\t-Line 15\n+\tdiff --git a/path1 b/path1\n+\tnew file mode 100644\n+\tindex 0000000..752c50e\n+\t--- /dev/null\n+\t+++ b/path1\n+\t@@ -0,0 +1,15 @@\n+\t+Line 1\n+\t+Line 2\n+\t+Line 3\n+\t+Line 4\n+\t+Line 5\n+\t+Line 6\n+\t+Line 7\n+\t+Line 8\n+\t+Line 9\n+\t+Line 10\n+\t+Line 11\n+\t+Line 12\n+\t+Line 13\n+\t+Line 14\n+\t+Line 15\n+\tEOF\n '\n \n test_expect_success \\\n\n\n\n\nMatthieu Moy (5):\n  Documentation/diff-config: fix description of diff.renames\n  t4001-diff-rename: wrap file creations in a test\n  t: add tests for diff.renames (true/false/unset)\n  log: introduce init_log_defaults()\n  diff: activate diff.renames by default\n\n Documentation/diff-config.txt |  10 +++-\n builtin/commit.c              |   1 +\n builtin/diff.c                |   1 +\n builtin/log.c                 |  16 ++++--\n builtin/merge.c               |   1 +\n diff.c                        |   5 ++\n diff.h                        |   1 +\n t/t4001-diff-rename.sh        | 125 +++++++++++++++++++++++++++++++-----------\n t/t4013-diff-various.sh       |   2 +\n t/t4014-format-patch.sh       |   4 +-\n t/t4047-diff-dirstat.sh       |   3 +-\n t/t4202-log.sh                |   8 +--\n 12 files changed, 131 insertions(+), 46 deletions(-)\n\n-- \n2.7.2.334.g35ed2ae.dirty\n"},{"id":"279296","messageId":"1456390761-27015-2-git-send-email-Matthieu.Moy@imag.fr","threadId":"41487","inReplyTo":"1456390761-27015-1-git-send-email-Matthieu.Moy@imag.fr","subject":"[PATCH v2 1/5] Documentation/diff-config: fix description of diff.renames","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2016-02-25T08:59:17Z","receivedAt":"2016-02-25T08:59:17Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"The description was misleading, since \"set to any boolean value\" include\n\"set to false\", and diff.renames=false does not enable basic detection,\nbut actually disables it. Also, document that diff.renames only affects\nPorcelain.\n\nSigned-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n---\n Documentation/diff-config.txt | 10 +++++++---\n 1 file changed, 7 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/diff-config.txt b/Documentation/diff-config.txt\nindex 6eaa452..40e5de9 100644\n--- a/Documentation/diff-config.txt\n+++ b/Documentation/diff-config.txt\n@@ -108,9 +108,13 @@ diff.renameLimit::\n \tdetection; equivalent to the 'git diff' option '-l'.\n \n diff.renames::\n-\tTells Git to detect renames.  If set to any boolean value, it\n-\twill enable basic rename detection.  If set to \"copies\" or\n-\t\"copy\", it will detect copies, as well.\n+\tWhether and how Git detects renames.  If set to \"false\",\n+\trename detection is disabled. If set to \"true\", basic rename\n+\tdetection is enable.  If set to \"copies\" or \"copy\", Git will\n+\tdetect copies, as well.  Defaults to false.  Note that this\n+\taffects only 'git diff' Porcelain like linkgit:git-diff[1] and\n+\tlinkgit:git-log[1], and not lower level commands such as\n+\tlinkgit:git-diff-files[1].\n \n diff.suppressBlankEmpty::\n \tA boolean to inhibit the standard behavior of printing a space\n-- \n2.7.2.334.g35ed2ae.dirty\n"},{"id":"279300","messageId":"1456390761-27015-3-git-send-email-Matthieu.Moy@imag.fr","threadId":"41487","inReplyTo":"1456390761-27015-1-git-send-email-Matthieu.Moy@imag.fr","subject":"[PATCH v2 2/5] t4001-diff-rename: wrap file creations in a test","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2016-02-25T08:59:18Z","receivedAt":"2016-02-25T08:59:18Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n---\n t/t4001-diff-rename.sh | 66 ++++++++++++++++++++++++++------------------------\n 1 file changed, 35 insertions(+), 31 deletions(-)\n\ndiff --git a/t/t4001-diff-rename.sh b/t/t4001-diff-rename.sh\nindex 2f327b7..06b8828 100755\n--- a/t/t4001-diff-rename.sh\n+++ b/t/t4001-diff-rename.sh\n@@ -9,21 +9,40 @@ test_description='Test rename detection in diff engine.\n . ./test-lib.sh\n . \"$TEST_DIRECTORY\"/diff-lib.sh\n \n-echo >path0 'Line 1\n-Line 2\n-Line 3\n-Line 4\n-Line 5\n-Line 6\n-Line 7\n-Line 8\n-Line 9\n-Line 10\n-line 11\n-Line 12\n-Line 13\n-Line 14\n-Line 15\n+test_expect_success 'setup' '\n+\tcat >path0 <<-\\EOF &&\n+\tLine 1\n+\tLine 2\n+\tLine 3\n+\tLine 4\n+\tLine 5\n+\tLine 6\n+\tLine 7\n+\tLine 8\n+\tLine 9\n+\tLine 10\n+\tline 11\n+\tLine 12\n+\tLine 13\n+\tLine 14\n+\tLine 15\n+\tEOF\n+\tcat >expected <<-\\EOF\n+\tdiff --git a/path0 b/path1\n+\trename from path0\n+\trename to path1\n+\t--- a/path0\n+\t+++ b/path1\n+\t@@ -8,7 +8,7 @@ Line 7\n+\t Line 8\n+\t Line 9\n+\t Line 10\n+\t-line 11\n+\t+Line 11\n+\t Line 12\n+\t Line 13\n+\t Line 14\n+\tEOF\n '\n \n test_expect_success \\\n@@ -43,22 +62,7 @@ test_expect_success \\\n test_expect_success \\\n     'git diff-index -p -M after rename and editing.' \\\n     'git diff-index -p -M $tree >current'\n-cat >expected <<\\EOF\n-diff --git a/path0 b/path1\n-rename from path0\n-rename to path1\n---- a/path0\n-+++ b/path1\n-@@ -8,7 +8,7 @@ Line 7\n- Line 8\n- Line 9\n- Line 10\n--line 11\n-+Line 11\n- Line 12\n- Line 13\n- Line 14\n-EOF\n+\n \n test_expect_success \\\n     'validate the output.' \\\n-- \n2.7.2.334.g35ed2ae.dirty\n"},{"id":"279298","messageId":"1456390761-27015-4-git-send-email-Matthieu.Moy@imag.fr","threadId":"41487","inReplyTo":"1456390761-27015-1-git-send-email-Matthieu.Moy@imag.fr","subject":"[PATCH v2 3/5] t: add tests for diff.renames (true/false/unset)","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2016-02-25T08:59:19Z","receivedAt":"2016-02-25T08:59:19Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"The underlying machinery is well-tested, but the configuration option\nitself was tested only in t3400-rebase.sh.\n\nSigned-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n---\n t/t4001-diff-rename.sh | 61 +++++++++++++++++++++++++++++++++++++++++++++++++-\n 1 file changed, 60 insertions(+), 1 deletion(-)\n\ndiff --git a/t/t4001-diff-rename.sh b/t/t4001-diff-rename.sh\nindex 06b8828..f5239b5 100755\n--- a/t/t4001-diff-rename.sh\n+++ b/t/t4001-diff-rename.sh\n@@ -27,7 +27,7 @@ test_expect_success 'setup' '\n \tLine 14\n \tLine 15\n \tEOF\n-\tcat >expected <<-\\EOF\n+\tcat >expected <<-\\EOF &&\n \tdiff --git a/path0 b/path1\n \trename from path0\n \trename to path1\n@@ -43,6 +43,50 @@ test_expect_success 'setup' '\n \t Line 13\n \t Line 14\n \tEOF\n+\tcat >no-rename <<-\\EOF\n+\tdiff --git a/path0 b/path0\n+\tdeleted file mode 100644\n+\tindex fdbec44..0000000\n+\t--- a/path0\n+\t+++ /dev/null\n+\t@@ -1,15 +0,0 @@\n+\t-Line 1\n+\t-Line 2\n+\t-Line 3\n+\t-Line 4\n+\t-Line 5\n+\t-Line 6\n+\t-Line 7\n+\t-Line 8\n+\t-Line 9\n+\t-Line 10\n+\t-line 11\n+\t-Line 12\n+\t-Line 13\n+\t-Line 14\n+\t-Line 15\n+\tdiff --git a/path1 b/path1\n+\tnew file mode 100644\n+\tindex 0000000..752c50e\n+\t--- /dev/null\n+\t+++ b/path1\n+\t@@ -0,0 +1,15 @@\n+\t+Line 1\n+\t+Line 2\n+\t+Line 3\n+\t+Line 4\n+\t+Line 5\n+\t+Line 6\n+\t+Line 7\n+\t+Line 8\n+\t+Line 9\n+\t+Line 10\n+\t+Line 11\n+\t+Line 12\n+\t+Line 13\n+\t+Line 14\n+\t+Line 15\n+\tEOF\n '\n \n test_expect_success \\\n@@ -68,6 +112,21 @@ test_expect_success \\\n     'validate the output.' \\\n     'compare_diff_patch current expected'\n \n+test_expect_success 'test diff.renames=true' '\n+\tgit -c diff.renames=true diff --cached $tree >current &&\n+\tcompare_diff_patch current expected\n+'\n+\n+test_expect_success 'test diff.renames=false' '\n+\tgit -c diff.renames=false diff --cached $tree >current &&\n+\tcompare_diff_patch current no-rename\n+'\n+\n+test_expect_success 'test diff.renames unset' '\n+\tgit diff --cached $tree >current &&\n+\tcompare_diff_patch current no-rename\n+'\n+\n test_expect_success 'favour same basenames over different ones' '\n \tcp path1 another-path &&\n \tgit add another-path &&\n-- \n2.7.2.334.g35ed2ae.dirty\n"},{"id":"279297","messageId":"1456390761-27015-5-git-send-email-Matthieu.Moy@imag.fr","threadId":"41487","inReplyTo":"1456390761-27015-1-git-send-email-Matthieu.Moy@imag.fr","subject":"[PATCH v2 4/5] log: introduce init_log_defaults()","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2016-02-25T08:59:20Z","receivedAt":"2016-02-25T08:59:20Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"This is currently a wrapper around init_grep_defaults(), but will allow\nadding more initialization in further patches.\n\nSigned-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n---\n builtin/log.c | 15 ++++++++++-----\n 1 file changed, 10 insertions(+), 5 deletions(-)\n\ndiff --git a/builtin/log.c b/builtin/log.c\nindex 0d738d6..7f96c64 100644\n--- a/builtin/log.c\n+++ b/builtin/log.c\n@@ -100,6 +100,11 @@ static int log_line_range_callback(const struct option *option, const char *arg,\n \treturn 0;\n }\n \n+static void init_log_defaults()\n+{\n+\tinit_grep_defaults();\n+}\n+\n static void cmd_log_init_defaults(struct rev_info *rev)\n {\n \tif (fmt_pretty)\n@@ -416,7 +421,7 @@ int cmd_whatchanged(int argc, const char **argv, const char *prefix)\n \tstruct rev_info rev;\n \tstruct setup_revision_opt opt;\n \n-\tinit_grep_defaults();\n+\tinit_log_defaults();\n \tgit_config(git_log_config, NULL);\n \n \tinit_revisions(&rev, prefix);\n@@ -527,7 +532,7 @@ int cmd_show(int argc, const char **argv, const char *prefix)\n \tstruct pathspec match_all;\n \tint i, count, ret = 0;\n \n-\tinit_grep_defaults();\n+\tinit_log_defaults();\n \tgit_config(git_log_config, NULL);\n \n \tmemset(&match_all, 0, sizeof(match_all));\n@@ -608,7 +613,7 @@ int cmd_log_reflog(int argc, const char **argv, const char *prefix)\n \tstruct rev_info rev;\n \tstruct setup_revision_opt opt;\n \n-\tinit_grep_defaults();\n+\tinit_log_defaults();\n \tgit_config(git_log_config, NULL);\n \n \tinit_revisions(&rev, prefix);\n@@ -647,7 +652,7 @@ int cmd_log(int argc, const char **argv, const char *prefix)\n \tstruct rev_info rev;\n \tstruct setup_revision_opt opt;\n \n-\tinit_grep_defaults();\n+\tinit_log_defaults();\n \tgit_config(git_log_config, NULL);\n \n \tinit_revisions(&rev, prefix);\n@@ -1280,7 +1285,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)\n \textra_hdr.strdup_strings = 1;\n \textra_to.strdup_strings = 1;\n \textra_cc.strdup_strings = 1;\n-\tinit_grep_defaults();\n+\tinit_log_defaults();\n \tgit_config(git_format_config, NULL);\n \tinit_revisions(&rev, prefix);\n \trev.commit_format = CMIT_FMT_EMAIL;\n-- \n2.7.2.334.g35ed2ae.dirty\n"},{"id":"279299","messageId":"1456390761-27015-6-git-send-email-Matthieu.Moy@imag.fr","threadId":"41487","inReplyTo":"1456390761-27015-1-git-send-email-Matthieu.Moy@imag.fr","subject":"[PATCH v2 5/5] diff: activate diff.renames by default","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2016-02-25T08:59:21Z","receivedAt":"2016-02-25T08:59:21Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Rename detection is a very convenient feature, and new users shouldn't\nhave to dig in the documentation to benefit from it.\n\nPotential objections to activating rename detection are that it\nsometimes fail, and it is sometimes slow. But rename detection is\nalready activated by default in several cases like \"git status\" and \"git\nmerge\", so activating diff.renames does not fundamentally change the\nsituation. When the rename detection fails, it now fails consistently\nbetween \"git diff\" and \"git status\".\n\nThis setting does not affect plumbing commands, hence well-written\nscripts will not be affected.\n\nSigned-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n---\n Documentation/diff-config.txt | 2 +-\n builtin/commit.c              | 1 +\n builtin/diff.c                | 1 +\n builtin/log.c                 | 1 +\n builtin/merge.c               | 1 +\n diff.c                        | 5 +++++\n diff.h                        | 1 +\n t/t4001-diff-rename.sh        | 2 +-\n t/t4013-diff-various.sh       | 2 ++\n t/t4014-format-patch.sh       | 4 ++--\n t/t4047-diff-dirstat.sh       | 3 ++-\n t/t4202-log.sh                | 8 ++++----\n 12 files changed, 22 insertions(+), 9 deletions(-)\n\ndiff --git a/Documentation/diff-config.txt b/Documentation/diff-config.txt\nindex 40e5de9..69389ae 100644\n--- a/Documentation/diff-config.txt\n+++ b/Documentation/diff-config.txt\n@@ -111,7 +111,7 @@ diff.renames::\n \tWhether and how Git detects renames.  If set to \"false\",\n \trename detection is disabled. If set to \"true\", basic rename\n \tdetection is enable.  If set to \"copies\" or \"copy\", Git will\n-\tdetect copies, as well.  Defaults to false.  Note that this\n+\tdetect copies, as well.  Defaults to true.  Note that this\n \taffects only 'git diff' Porcelain like linkgit:git-diff[1] and\n \tlinkgit:git-log[1], and not lower level commands such as\n \tlinkgit:git-diff-files[1].\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex b3bd2d4..109742e 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -186,6 +186,7 @@ static void status_init_config(struct wt_status *s, config_fn_t fn)\n \tgitmodules_config();\n \tgit_config(fn, s);\n \tdetermine_whence(s);\n+\tinit_diff_ui_defaults();\n \ts->hints = advice_status_hints; /* must come after git_config() */\n }\n \ndiff --git a/builtin/diff.c b/builtin/diff.c\nindex 52c98a9..343c6b8 100644\n--- a/builtin/diff.c\n+++ b/builtin/diff.c\n@@ -318,6 +318,7 @@ int cmd_diff(int argc, const char **argv, const char *prefix)\n \n \tif (!no_index)\n \t\tgitmodules_config();\n+\tinit_diff_ui_defaults();\n \tgit_config(git_diff_ui_config, NULL);\n \n \tinit_revisions(&rev, prefix);\ndiff --git a/builtin/log.c b/builtin/log.c\nindex 7f96c64..c05a5f6 100644\n--- a/builtin/log.c\n+++ b/builtin/log.c\n@@ -103,6 +103,7 @@ static int log_line_range_callback(const struct option *option, const char *arg,\n static void init_log_defaults()\n {\n \tinit_grep_defaults();\n+\tinit_diff_ui_defaults();\n }\n \n static void cmd_log_init_defaults(struct rev_info *rev)\ndiff --git a/builtin/merge.c b/builtin/merge.c\nindex b98a348..4cb4f6a 100644\n--- a/builtin/merge.c\n+++ b/builtin/merge.c\n@@ -1187,6 +1187,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)\n \telse\n \t\thead_commit = lookup_commit_or_die(head_sha1, \"HEAD\");\n \n+\tinit_diff_ui_defaults();\n \tgit_config(git_merge_config, NULL);\n \n \tif (branch_mergeoptions)\ndiff --git a/diff.c b/diff.c\nindex 2136b69..b4dea07 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -168,6 +168,11 @@ long parse_algorithm_value(const char *value)\n  * never be affected by the setting of diff.renames\n  * the user happens to have in the configuration file.\n  */\n+void init_diff_ui_defaults(void)\n+{\n+\tdiff_detect_rename_default = 1;\n+}\n+\n int git_diff_ui_config(const char *var, const char *value, void *cb)\n {\n \tif (!strcmp(var, \"diff.color\") || !strcmp(var, \"color.diff\")) {\ndiff --git a/diff.h b/diff.h\nindex 70b2d70..0a3ce86 100644\n--- a/diff.h\n+++ b/diff.h\n@@ -266,6 +266,7 @@ extern int parse_long_opt(const char *opt, const char **argv,\n \t\t\t const char **optarg);\n \n extern int git_diff_basic_config(const char *var, const char *value, void *cb);\n+extern void init_diff_ui_defaults(void);\n extern int git_diff_ui_config(const char *var, const char *value, void *cb);\n extern void diff_setup(struct diff_options *);\n extern int diff_opt_parse(struct diff_options *, const char **, int, const char *);\ndiff --git a/t/t4001-diff-rename.sh b/t/t4001-diff-rename.sh\nindex f5239b5..c7e58b6 100755\n--- a/t/t4001-diff-rename.sh\n+++ b/t/t4001-diff-rename.sh\n@@ -124,7 +124,7 @@ test_expect_success 'test diff.renames=false' '\n \n test_expect_success 'test diff.renames unset' '\n \tgit diff --cached $tree >current &&\n-\tcompare_diff_patch current no-rename\n+\tcompare_diff_patch current expected\n '\n \n test_expect_success 'favour same basenames over different ones' '\ndiff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh\nindex 6ec6072..94ef500 100755\n--- a/t/t4013-diff-various.sh\n+++ b/t/t4013-diff-various.sh\n@@ -90,6 +90,8 @@ test_expect_success setup '\n \tgit commit -m \"Rearranged lines in dir/sub\" &&\n \tgit checkout master &&\n \n+\tgit config diff.renames false &&\n+\n \tgit show-branch\n '\n \ndiff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh\nindex 3b99434..eed2981 100755\n--- a/t/t4014-format-patch.sh\n+++ b/t/t4014-format-patch.sh\n@@ -549,7 +549,7 @@ test_expect_success 'cover-letter inherits diff options' '\n \n \tgit mv file foo &&\n \tgit commit -m foo &&\n-\tgit format-patch --cover-letter -1 &&\n+\tgit format-patch --no-renames --cover-letter -1 &&\n \tcheck_patch 0000-cover-letter.patch &&\n \t! grep \"file => foo .* 0 *\\$\" 0000-cover-letter.patch &&\n \tgit format-patch --cover-letter -1 -M &&\n@@ -703,7 +703,7 @@ test_expect_success 'options no longer allowed for format-patch' '\n \n test_expect_success 'format-patch --numstat should produce a patch' '\n \tgit format-patch --numstat --stdout master..side > output &&\n-\ttest 6 = $(grep \"^diff --git a/\" output | wc -l)'\n+\ttest 5 = $(grep \"^diff --git a/\" output | wc -l)'\n \n test_expect_success 'format-patch -- <path>' '\n \tgit format-patch master..side -- file 2>error &&\ndiff --git a/t/t4047-diff-dirstat.sh b/t/t4047-diff-dirstat.sh\nindex 3b8b792..447a8ff 100755\n--- a/t/t4047-diff-dirstat.sh\n+++ b/t/t4047-diff-dirstat.sh\n@@ -248,7 +248,8 @@ EOF\n \tgit rm -r src/move/unchanged &&\n \tgit rm -r src/move/changed &&\n \tgit rm -r src/move/rearranged &&\n-\tgit commit -m \"changes\"\n+\tgit commit -m \"changes\" &&\n+\tgit config diff.renames false\n '\n \n cat <<EOF >expect_diff_stat\ndiff --git a/t/t4202-log.sh b/t/t4202-log.sh\nindex cb82eb7..128ba93 100755\n--- a/t/t4202-log.sh\n+++ b/t/t4202-log.sh\n@@ -101,8 +101,8 @@ test_expect_success 'oneline' '\n \n test_expect_success 'diff-filter=A' '\n \n-\tgit log --pretty=\"format:%s\" --diff-filter=A HEAD > actual &&\n-\tgit log --pretty=\"format:%s\" --diff-filter A HEAD > actual-separate &&\n+\tgit log --no-renames --pretty=\"format:%s\" --diff-filter=A HEAD > actual &&\n+\tgit log --no-renames --pretty=\"format:%s\" --diff-filter A HEAD > actual-separate &&\n \tprintf \"fifth\\nfourth\\nthird\\ninitial\" > expect &&\n \ttest_cmp expect actual &&\n \ttest_cmp expect actual-separate\n@@ -119,7 +119,7 @@ test_expect_success 'diff-filter=M' '\n \n test_expect_success 'diff-filter=D' '\n \n-\tactual=$(git log --pretty=\"format:%s\" --diff-filter=D HEAD) &&\n+\tactual=$(git log --no-renames --pretty=\"format:%s\" --diff-filter=D HEAD) &&\n \texpect=$(echo sixth ; echo third) &&\n \tverbose test \"$actual\" = \"$expect\"\n \n@@ -848,7 +848,7 @@ sanitize_output () {\n }\n \n test_expect_success 'log --graph with diff and stats' '\n-\tgit log --graph --pretty=short --stat -p >actual &&\n+\tgit log --no-renames --graph --pretty=short --stat -p >actual &&\n \tsanitize_output >actual.sanitized <actual &&\n \ttest_i18ncmp expect actual.sanitized\n '\n-- \n2.7.2.334.g35ed2ae.dirty\n"},{"id":"279348","messageId":"loom.20160225T181310-74@post.gmane.org","threadId":"41487","inReplyTo":"1456249498-3232-2-git-send-email-Matthieu.Moy@imag.fr","subject":"Re: [PATCH 1/5] Documentation/diff-config: fix description of diff.renames","fromName":"Felipe Gonçalves Assis","fromEmail":"felipeg.assis@gmail.com","sentAt":"2016-02-25T17:27:02Z","receivedAt":"2016-02-25T17:27:02Z","isPatch":true,"sender":{"key":"felipeg.assis@gmail.com","avatar":null},"body":"Matthieu Moy <Matthieu.Moy <at> imag.fr> writes:\n\n>  diff.renames::\n> -\tTells Git to detect renames.  If set to any boolean value, it\n> -\twill enable basic rename detection.  If set to \"copies\" or\n> -\t\"copy\", it will detect copies, as well.\n> +\tWhether and how Git detects renames.  If set to \"false\",\n> +\trename detection is disabled. If set to \"true\", basic rename\n> +\tdetection is enable.  If set to \"copies\" or \"copy\", Git will\n> +\tdetect copies, as well.  Defaults to false.\n\nJust a minor typo: s/enable/enabled/\nAlso, there is only one space between the second and third sentences.\n\nJust in case you haven't already fixed that.\n\nRegards,\nFelipe\n"},{"id":"279350","messageId":"vpqvb5c3d8f.fsf@anie.imag.fr","threadId":"41487","inReplyTo":"loom.20160225T181310-74@post.gmane.org","subject":"Re: [PATCH 1/5] Documentation/diff-config: fix description of diff.renames","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2016-02-25T17:34:56Z","receivedAt":"2016-02-25T17:34:56Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Felipe Gonçalves Assis <felipeg.assis@gmail.com> writes:\n\n> Matthieu Moy <Matthieu.Moy <at> imag.fr> writes:\n>\n>>  diff.renames::\n>> -\tTells Git to detect renames.  If set to any boolean value, it\n>> -\twill enable basic rename detection.  If set to \"copies\" or\n>> -\t\"copy\", it will detect copies, as well.\n>> +\tWhether and how Git detects renames.  If set to \"false\",\n>> +\trename detection is disabled. If set to \"true\", basic rename\n>> +\tdetection is enable.  If set to \"copies\" or \"copy\", Git will\n>> +\tdetect copies, as well.  Defaults to false.\n>\n> Just a minor typo: s/enable/enabled/\n> Also, there is only one space between the second and third sentences.\n\nIndeed. Thanks.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"279351","messageId":"1456421878-443-1-git-send-email-Matthieu.Moy@imag.fr","threadId":"41487","inReplyTo":"1456390761-27015-2-git-send-email-Matthieu.Moy@imag.fr","subject":"[PATCH v2.1] Documentation/diff-config: fix description of diff.renames","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2016-02-25T17:37:58Z","receivedAt":"2016-02-25T17:37:58Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"The description was misleading, since \"set to any boolean value\" include\n\"set to false\", and diff.renames=false does not enable basic detection,\nbut actually disables it. Also, document that diff.renames only affects\nPorcelain.\n\nSigned-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n---\nOops, trivial fix for typo noticed by Felipe. I'm resending just this\none in case Junio wants to pick the latest version but I can obviously\nresend the whole if needed.\n\n Documentation/diff-config.txt | 10 +++++++---\n 1 file changed, 7 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/diff-config.txt b/Documentation/diff-config.txt\nindex 6eaa452..b5e9bda 100644\n--- a/Documentation/diff-config.txt\n+++ b/Documentation/diff-config.txt\n@@ -108,9 +108,13 @@ diff.renameLimit::\n \tdetection; equivalent to the 'git diff' option '-l'.\n \n diff.renames::\n-\tTells Git to detect renames.  If set to any boolean value, it\n-\twill enable basic rename detection.  If set to \"copies\" or\n-\t\"copy\", it will detect copies, as well.\n+\tWhether and how Git detects renames.  If set to \"false\",\n+\trename detection is disabled.  If set to \"true\", basic rename\n+\tdetection is enabled.  If set to \"copies\" or \"copy\", Git will\n+\tdetect copies, as well.  Defaults to false.  Note that this\n+\taffects only 'git diff' Porcelain like linkgit:git-diff[1] and\n+\tlinkgit:git-log[1], and not lower level commands such as\n+\tlinkgit:git-diff-files[1].\n \n diff.suppressBlankEmpty::\n \tA boolean to inhibit the standard behavior of printing a space\n-- \n2.7.2.334.g35ed2ae.dirty\n"},{"id":"279353","messageId":"xmqq60xcpthz.fsf@gitster.mtv.corp.google.com","threadId":"41487","inReplyTo":"1456390761-27015-6-git-send-email-Matthieu.Moy@imag.fr","subject":"Re: [PATCH v2 5/5] diff: activate diff.renames by default","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-02-25T17:52:40Z","receivedAt":"2016-02-25T17:52:40Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthieu Moy <Matthieu.Moy@imag.fr> writes:\n\n> diff --git a/Documentation/diff-config.txt b/Documentation/diff-config.txt\n> index 40e5de9..69389ae 100644\n> --- a/Documentation/diff-config.txt\n> +++ b/Documentation/diff-config.txt\n> @@ -111,7 +111,7 @@ diff.renames::\n>  \tWhether and how Git detects renames.  If set to \"false\",\n>  \trename detection is disabled. If set to \"true\", basic rename\n>  \tdetection is enable.  If set to \"copies\" or \"copy\", Git will\n\nNot a new issue, but s/enable/&d/, I think.\n\n> -\tdetect copies, as well.  Defaults to false.  Note that this\n> +\tdetect copies, as well.  Defaults to true.  Note that this\n>  \taffects only 'git diff' Porcelain like linkgit:git-diff[1] and\n>  \tlinkgit:git-log[1], and not lower level commands such as\n>  \tlinkgit:git-diff-files[1].\n"},{"id":"279354","messageId":"xmqq1t80ptgx.fsf@gitster.mtv.corp.google.com","threadId":"41487","inReplyTo":"1456390761-27015-2-git-send-email-Matthieu.Moy@imag.fr","subject":"Re: [PATCH v2 1/5] Documentation/diff-config: fix description of diff.renames","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-02-25T17:53:18Z","receivedAt":"2016-02-25T17:53:18Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthieu Moy <Matthieu.Moy@imag.fr> writes:\n\n> The description was misleading, since \"set to any boolean value\" include\n> \"set to false\", and diff.renames=false does not enable basic detection,\n> but actually disables it. Also, document that diff.renames only affects\n> Porcelain.\n>\n> Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n> ---\n>  Documentation/diff-config.txt | 10 +++++++---\n>  1 file changed, 7 insertions(+), 3 deletions(-)\n>\n> diff --git a/Documentation/diff-config.txt b/Documentation/diff-config.txt\n> index 6eaa452..40e5de9 100644\n> --- a/Documentation/diff-config.txt\n> +++ b/Documentation/diff-config.txt\n> @@ -108,9 +108,13 @@ diff.renameLimit::\n>  \tdetection; equivalent to the 'git diff' option '-l'.\n>  \n>  diff.renames::\n> -\tTells Git to detect renames.  If set to any boolean value, it\n> -\twill enable basic rename detection.  If set to \"copies\" or\n> -\t\"copy\", it will detect copies, as well.\n> +\tWhether and how Git detects renames.  If set to \"false\",\n> +\trename detection is disabled. If set to \"true\", basic rename\n> +\tdetection is enable.  If set to \"copies\" or \"copy\", Git will\n\nAhh, I earlier said \"Not a new issue\", but it is introduced here ;-)\n\nI'll patch them up.  Thanks.\n\n\n> +\tdetect copies, as well.  Defaults to false.  Note that this\n> +\taffects only 'git diff' Porcelain like linkgit:git-diff[1] and\n> +\tlinkgit:git-log[1], and not lower level commands such as\n> +\tlinkgit:git-diff-files[1].\n>  \n>  diff.suppressBlankEmpty::\n>  \tA boolean to inhibit the standard behavior of printing a space\n"},{"id":"279359","messageId":"xmqqoab4odq8.fsf@gitster.mtv.corp.google.com","threadId":"41487","inReplyTo":"1456421878-443-1-git-send-email-Matthieu.Moy@imag.fr","subject":"Re: [PATCH v2.1] Documentation/diff-config: fix description of diff.renames","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-02-25T18:18:39Z","receivedAt":"2016-02-25T18:18:39Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthieu Moy <Matthieu.Moy@imag.fr> writes:\n\n> The description was misleading, since \"set to any boolean value\" include\n> \"set to false\", and diff.renames=false does not enable basic detection,\n> but actually disables it. Also, document that diff.renames only affects\n> Porcelain.\n>\n> Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n> ---\n> Oops, trivial fix for typo noticed by Felipe. I'm resending just this\n> one in case Junio wants to pick the latest version but I can obviously\n> resend the whole if needed.\n\nHeh, I guess people independently spotted the same typo nearly\nsimultaneously ;-)\n\nI think I got this fixed locally (and adjusted the last one to\nmatch).  Thanks.\n\n\n>\n>  Documentation/diff-config.txt | 10 +++++++---\n>  1 file changed, 7 insertions(+), 3 deletions(-)\n>\n> diff --git a/Documentation/diff-config.txt b/Documentation/diff-config.txt\n> index 6eaa452..b5e9bda 100644\n> --- a/Documentation/diff-config.txt\n> +++ b/Documentation/diff-config.txt\n> @@ -108,9 +108,13 @@ diff.renameLimit::\n>  \tdetection; equivalent to the 'git diff' option '-l'.\n>  \n>  diff.renames::\n> -\tTells Git to detect renames.  If set to any boolean value, it\n> -\twill enable basic rename detection.  If set to \"copies\" or\n> -\t\"copy\", it will detect copies, as well.\n> +\tWhether and how Git detects renames.  If set to \"false\",\n> +\trename detection is disabled.  If set to \"true\", basic rename\n> +\tdetection is enabled.  If set to \"copies\" or \"copy\", Git will\n> +\tdetect copies, as well.  Defaults to false.  Note that this\n> +\taffects only 'git diff' Porcelain like linkgit:git-diff[1] and\n> +\tlinkgit:git-log[1], and not lower level commands such as\n> +\tlinkgit:git-diff-files[1].\n>  \n>  diff.suppressBlankEmpty::\n>  \tA boolean to inhibit the standard behavior of printing a space\n"},{"id":"279369","messageId":"xmqqk2lsoacb.fsf@gitster.mtv.corp.google.com","threadId":"41487","inReplyTo":"1456390761-27015-5-git-send-email-Matthieu.Moy@imag.fr","subject":"Re: [PATCH v2 4/5] log: introduce init_log_defaults()","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-02-25T19:31:48Z","receivedAt":"2016-02-25T19:31:48Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthieu Moy <Matthieu.Moy@imag.fr> writes:\n\n> This is currently a wrapper around init_grep_defaults(), but will allow\n> adding more initialization in further patches.\n>\n> Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n> ---\n>  builtin/log.c | 15 ++++++++++-----\n>  1 file changed, 10 insertions(+), 5 deletions(-)\n>\n> diff --git a/builtin/log.c b/builtin/log.c\n> index 0d738d6..7f96c64 100644\n> --- a/builtin/log.c\n> +++ b/builtin/log.c\n> @@ -100,6 +100,11 @@ static int log_line_range_callback(const struct option *option, const char *arg,\n>  \treturn 0;\n>  }\n>  \n> +static void init_log_defaults()\n\n\tstatic void init_log_defaults(void).\n\nLocally patched up already; no need to resend.\n\nThanks.\n"}]}