stash: allow "stash show" diff output configurable
[gitweb.git] / git-stash.sh
index 8e9e2cd7d5697c1f2b7ccb8753d384d9f4461bef..92bc0e1ad821291512604d1e931e57e1a4a5d0f5 100755 (executable)
@@ -307,7 +307,25 @@ show_stash () {
        ALLOW_UNKNOWN_FLAGS=t
        assert_stash_like "$@"
 
-       git diff ${FLAGS:---stat} $b_commit $w_commit
+       if test -z "$FLAGS"
+       then
+               if test "$(git config --bool stash.showStat || echo true)" = "true"
+               then
+                       FLAGS=--stat
+               fi
+
+               if test "$(git config --bool stash.showPatch || echo false)" = "true"
+               then
+                       FLAGS=${FLAGS}${FLAGS:+ }-p
+               fi
+
+               if test -z "$FLAGS"
+               then
+                       return 0
+               fi
+       fi
+
+       git diff ${FLAGS} $b_commit $w_commit
 }
 
 show_help () {