Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15

Re: [PATCH v2] diff: vary default prefix depending on what are compared

From: Jakub Narebski <hidden>
Date: 2016-06-15 22:45:11

Junio C Hamano [off-list ref] writes:
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 --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.
 
+	diff_set_mnemonic_prefix(&revs->diffopt, "o/", "w/");
+
Somehow you lost in the commit description and in the added
documentation the (o)bject prefix (explicitely naming 'blob' object,
for example HEAD:a, or :2:b, or 7a7ff130a34942506e6068105ac5946c9404bf18)

It is also not obvious IMVHO that when comparing two trees (two
commits) git uses default 'a/'..'b/' prefixes.

-- 
Jakub Narebski
Poland
ShadeHawk on #git
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help