diff options
author | Junio C Hamano <junkio@cox.net> | 2007-05-29 00:38:52 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2007-05-29 00:38:52 -0700 |
commit | 8250465859644eee5db3c1169db689beca65a868 (patch) | |
tree | 44825f673b9676adeed70410ceed1f043175083a /git-merge.sh | |
parent | 9953a00ef26386e16bc12d10669f41596c8ab3c6 (diff) | |
parent | 51e7ecf4ecb506fb36cd5933cb7b78fb4b315ac9 (diff) | |
download | git-8250465859644eee5db3c1169db689beca65a868.tar.gz |
Merge branch 'ar/mergestat'
* ar/mergestat:
Add a configuration option to control diffstat after merge
Diffstat (limited to 'git-merge.sh')
-rwxr-xr-x | git-merge.sh | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/git-merge.sh b/git-merge.sh index ff92aaf3f9..981d69d35f 100755 --- a/git-merge.sh +++ b/git-merge.sh @@ -3,7 +3,7 @@ # Copyright (c) 2005 Junio C Hamano # -USAGE='[-n] [--no-commit] [--squash] [-s <strategy>] [-m=<merge-message>] <commit>+' +USAGE='[-n] [--summary] [--no-commit] [--squash] [-s <strategy>] [-m=<merge-message>] <commit>+' SUBDIRECTORY_OK=Yes . git-sh-setup @@ -88,12 +88,11 @@ finish () { '') ;; ?*) - case "$no_summary" in - '') + if test "$show_diffstat" = t + then # We want color (if set), but no pager GIT_PAGER='' git-diff --stat --summary -M "$head" "$1" - ;; - esac + fi ;; esac } @@ -126,7 +125,9 @@ do case "$1" in -n|--n|--no|--no-|--no-s|--no-su|--no-sum|--no-summ|\ --no-summa|--no-summar|--no-summary) - no_summary=t ;; + show_diffstat=false ;; + --summary) + show_diffstat=t ;; --sq|--squ|--squa|--squas|--squash) squash=t no_commit=t ;; --no-c|--no-co|--no-com|--no-comm|--no-commi|--no-commit) @@ -168,6 +169,11 @@ do shift done +if test -z "$show_diffstat"; then + test "$(git-config --bool merge.diffstat)" = false && show_diffstat=false + test -z "$show_diffstat" && show_diffstat=t +fi + # This could be traditional "merge <msg> HEAD <commit>..." and the # way we can tell it is to see if the second token is HEAD, but some # people might have misused the interface and used a committish that |