summaryrefslogtreecommitdiff
path: root/diff-no-index.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2008-08-18 20:08:09 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2008-08-30 20:53:24 -0700
commita5a818ee4877e4458e8e6741a03ac3b19941d58a (patch)
tree5aaac05e0e8951fbafef1cef8eb4230a9bfe563c /diff-no-index.c
parenttutorial: gentler illustration of Alice/Bob workflow using gitk (diff)
downloadtgif-a5a818ee4877e4458e8e6741a03ac3b19941d58a.tar.xz
diff: vary default prefix depending on what are compared
With a new configuration "diff.mnemonicprefix", "git diff" shows the differences between various combinations of preimage and postimage trees with prefixes different from the standard "a/" and "b/". Hopefully this will make the distinction stand out for some people. "git diff" compares the (i)ndex and the (w)ork tree; "git diff HEAD" compares a (c)ommit and the (w)ork tree; "git diff --cached" compares a (c)ommit and the (i)ndex; "git-diff HEAD:file1 file2" compares an (o)bject and a (w)ork tree entity; "git diff --no-index a b" compares two non-git things (1) and (2). Because these mnemonics now have meanings, they are swapped when reverse diff is in effect and this feature is enabled. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff-no-index.c')
-rw-r--r--diff-no-index.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/diff-no-index.c b/diff-no-index.c
index 7d68b7f1be..b60d3455da 100644
--- a/diff-no-index.c
+++ b/diff-no-index.c
@@ -252,6 +252,7 @@ void diff_no_index(struct rev_info *revs,
if (queue_diff(&revs->diffopt, revs->diffopt.paths[0],
revs->diffopt.paths[1]))
exit(1);
+ diff_set_mnemonic_prefix(&revs->diffopt, "1/", "2/");
diffcore_std(&revs->diffopt);
diff_flush(&revs->diffopt);