From: Junio C Hamano Date: Tue, 29 May 2007 07:38:52 +0000 (-0700) Subject: Merge branch 'ar/mergestat' X-Git-Tag: v1.5.3-rc0~187 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/8250465859644eee5db3c1169db689beca65a868?ds=inline;hp=-c Merge branch 'ar/mergestat' * ar/mergestat: Add a configuration option to control diffstat after merge --- 8250465859644eee5db3c1169db689beca65a868 diff --combined git-merge.sh index ff92aaf3f9,44e9b70a65..981d69d35f --- a/git-merge.sh +++ b/git-merge.sh @@@ -3,7 -3,7 +3,7 @@@ # Copyright (c) 2005 Junio C Hamano # - USAGE='[-n] [--no-commit] [--squash] [-s ] [-m=] +' + USAGE='[-n] [--summary] [--no-commit] [--squash] [-s ] [-m=] +' SUBDIRECTORY_OK=Yes . git-sh-setup @@@ -88,12 -88,11 +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 +125,9 @@@ d 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 +169,11 @@@ 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 HEAD ..." 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 @@@ -329,7 -335,7 +335,7 @@@ f,* then echo "Wonderful." result_commit=$( - echo "$merge_msg" | + printf '%s\n' "$merge_msg" | git-commit-tree $result_tree -p HEAD -p "$1" ) || exit finish "$result_commit" "In-index merge" @@@ -434,7 -440,7 +440,7 @@@ don if test '' != "$result_tree" then parents=$(git-show-branch --independent "$head" "$@" | sed -e 's/^/-p /') - result_commit=$(echo "$merge_msg" | git-commit-tree $result_tree $parents) || exit + result_commit=$(printf '%s\n' "$merge_msg" | git-commit-tree $result_tree $parents) || exit finish "$result_commit" "Merge made by $wt_strategy." dropsave exit 0 @@@ -473,7 -479,7 +479,7 @@@ els do echo $remote done >"$GIT_DIR/MERGE_HEAD" - echo "$merge_msg" >"$GIT_DIR/MERGE_MSG" + printf '%s\n' "$merge_msg" >"$GIT_DIR/MERGE_MSG" fi if test "$merge_was_ok" = t