• Junio C Hamano's avatar
    diff: vary default prefix depending on what are compared · a5a818ee
    Junio C Hamano authored
    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: default avatarJunio C Hamano <[email protected]>
    a5a818ee
diff-no-index.c 5.91 KB