{"thread":{"id":"17870","subject":"[PATCH] Skip timestamp differences for diff --no-index","startedAt":"2009-02-18T06:48:06Z","lastAt":"2009-02-18T10:53:50Z","messageCount":2,"participants":["Michael Spang","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"105275","messageId":"1234939686-14932-1-git-send-email-mspang@uwaterloo.ca","threadId":"17870","inReplyTo":null,"subject":"[PATCH] Skip timestamp differences for diff --no-index","fromName":"Michael Spang","fromEmail":"mspang@uwaterloo.ca","sentAt":"2009-02-18T06:48:06Z","receivedAt":"2009-02-18T06:48:06Z","isPatch":true,"sender":{"key":"mspang@uwaterloo.ca","avatar":null},"body":"We display empty diffs for files whose timestamps have changed.\nUsually, refreshing the index makes those empty diffs go away.\nHowever, when not using the index they are not very useful and\nthere is no option to suppress them.\n\nThis forces on the skip_stat_unmatch option for diff --no-index,\nsuppressing any empty diffs. This option is also used for diffs\nagainst the index when \"diff.autorefreshindex\" is set, but that\noption does not apply to diff --no-index.\n\nSigned-off-by: Michael Spang <mspang@uwaterloo.ca>\n---\n diff-no-index.c                       |    1 +\n t/t4013-diff-various.sh               |    5 +++++\n t/t4013/diff.diff_--no-index_dir_dir3 |    2 ++\n 3 files changed, 8 insertions(+), 0 deletions(-)\n create mode 100644 t/t4013/diff.diff_--no-index_dir_dir3\n\ndiff --git a/diff-no-index.c b/diff-no-index.c\nindex 0dbd9da..0a14268 100644\n--- a/diff-no-index.c\n+++ b/diff-no-index.c\n@@ -247,6 +247,7 @@ void diff_no_index(struct rev_info *revs,\n \telse\n \t\trevs->diffopt.paths = argv + argc - 2;\n \trevs->diffopt.nr_paths = 2;\n+\trevs->diffopt.skip_stat_unmatch = 1;\n \n \tDIFF_OPT_SET(&revs->diffopt, EXIT_WITH_STATUS);\n \tDIFF_OPT_SET(&revs->diffopt, NO_INDEX);\ndiff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh\nindex aba5320..9c70902 100755\n--- a/t/t4013-diff-various.sh\n+++ b/t/t4013-diff-various.sh\n@@ -74,6 +74,10 @@ test_expect_success setup '\n \tfor i in 1 2; do echo $i; done >>dir/sub &&\n \tgit update-index file0 dir/sub &&\n \n+\tmkdir dir3 &&\n+\tcp dir/sub dir3/sub &&\n+\ttest-chmtime +1 dir3/sub &&\n+\n \tgit config log.showroot false &&\n \tgit commit --amend &&\n \tgit show-branch\n@@ -262,6 +266,7 @@ diff --patch-with-raw -r initial..side\n diff --name-status dir2 dir\n diff --no-index --name-status dir2 dir\n diff --no-index --name-status -- dir2 dir\n+diff --no-index dir dir3\n diff master master^ side\n EOF\n \ndiff --git a/t/t4013/diff.diff_--no-index_dir_dir3 b/t/t4013/diff.diff_--no-index_dir_dir3\nnew file mode 100644\nindex 0000000..2142c2b\n--- /dev/null\n+++ b/t/t4013/diff.diff_--no-index_dir_dir3\n@@ -0,0 +1,2 @@\n+$ git diff --no-index dir dir3\n+$\n-- \n1.6.0.6\n"},{"id":"105290","messageId":"alpine.DEB.1.00.0902181153050.6274@intel-tinevez-2-302","threadId":"17870","inReplyTo":"1234939686-14932-1-git-send-email-mspang@uwaterloo.ca","subject":"Re: [PATCH] Skip timestamp differences for diff --no-index","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-02-18T10:53:50Z","receivedAt":"2009-02-18T10:53:50Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 18 Feb 2009, Michael Spang wrote:\n\n> We display empty diffs for files whose timestamps have changed.\n> Usually, refreshing the index makes those empty diffs go away.\n> However, when not using the index they are not very useful and\n> there is no option to suppress them.\n> \n> This forces on the skip_stat_unmatch option for diff --no-index,\n> suppressing any empty diffs. This option is also used for diffs\n> against the index when \"diff.autorefreshindex\" is set, but that\n> option does not apply to diff --no-index.\n> \n> Signed-off-by: Michael Spang <mspang@uwaterloo.ca>\n> ---\n\nNice!  And very nicely written patch!\n\nThanks,\nDscho\n"}]}