summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bed5122)
raw | patch | inline | side by side (parent: bed5122)
author | Michael Spang <mspang@uwaterloo.ca> | |
Wed, 18 Feb 2009 06:48:06 +0000 (01:48 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 18 Feb 2009 18:55:33 +0000 (10:55 -0800) |
We display empty diffs for files whose timestamps have changed.
Usually, refreshing the index makes those empty diffs go away.
However, when not using the index they are not very useful and
there is no option to suppress them.
This forces on the skip_stat_unmatch option for diff --no-index,
suppressing any empty diffs. This option is also used for diffs
against the index when "diff.autorefreshindex" is set, but that
option does not apply to diff --no-index.
Signed-off-by: Michael Spang <mspang@uwaterloo.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Usually, refreshing the index makes those empty diffs go away.
However, when not using the index they are not very useful and
there is no option to suppress them.
This forces on the skip_stat_unmatch option for diff --no-index,
suppressing any empty diffs. This option is also used for diffs
against the index when "diff.autorefreshindex" is set, but that
option does not apply to diff --no-index.
Signed-off-by: Michael Spang <mspang@uwaterloo.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff-no-index.c | patch | blob | history | |
t/t4013-diff-various.sh | patch | blob | history | |
t/t4013/diff.diff_--no-index_dir_dir3 | [new file with mode: 0644] | patch | blob |
diff --git a/diff-no-index.c b/diff-no-index.c
index 60ed17470a6a2bf9bea202a04004b06d207a77d7..2d541d9aba11ee69525a6a1ef5da6f8a61e9e65e 100644 (file)
--- a/diff-no-index.c
+++ b/diff-no-index.c
else
revs->diffopt.paths = argv + argc - 2;
revs->diffopt.nr_paths = 2;
+ revs->diffopt.skip_stat_unmatch = 1;
DIFF_OPT_SET(&revs->diffopt, EXIT_WITH_STATUS);
DIFF_OPT_SET(&revs->diffopt, NO_INDEX);
index aba53202f84b6c6c16a68f45ccfa42368e47d421..9c709022efb1b553ef53b3100d39e852117cbeda 100755 (executable)
--- a/t/t4013-diff-various.sh
+++ b/t/t4013-diff-various.sh
for i in 1 2; do echo $i; done >>dir/sub &&
git update-index file0 dir/sub &&
+ mkdir dir3 &&
+ cp dir/sub dir3/sub &&
+ test-chmtime +1 dir3/sub &&
+
git config log.showroot false &&
git commit --amend &&
git show-branch
diff --name-status dir2 dir
diff --no-index --name-status dir2 dir
diff --no-index --name-status -- dir2 dir
+diff --no-index dir dir3
diff master master^ side
EOF
diff --git a/t/t4013/diff.diff_--no-index_dir_dir3 b/t/t4013/diff.diff_--no-index_dir_dir3
--- /dev/null
@@ -0,0 +1,2 @@
+$ git diff --no-index dir dir3
+$