Skip to content

Commit

Permalink
Merge branch 'ar/mergestat'
Browse files Browse the repository at this point in the history
* ar/mergestat:
  Add a configuration option to control diffstat after merge
  • Loading branch information
Junio C Hamano committed May 29, 2007
2 parents 9953a00 + 51e7ecf commit 8250465
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Documentation/git-merge.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ git-merge - Join two or more development histories together
SYNOPSIS
--------
[verse]
'git-merge' [-n] [--no-commit] [--squash] [-s <strategy>]...
'git-merge' [-n] [--summary] [--no-commit] [--squash] [-s <strategy>]...
[-m <msg>] <remote> <remote>...

DESCRIPTION
Expand Down
4 changes: 4 additions & 0 deletions Documentation/merge-options.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
--summary::
Show a diffstat at the end of the merge. The diffstat is also
controlled by the configuration option merge.diffstat.

-n, \--no-summary::
Do not show diffstat at the end of the merge.

Expand Down
18 changes: 12 additions & 6 deletions git-merge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions git-pull.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ do
-n|--n|--no|--no-|--no-s|--no-su|--no-sum|--no-summ|\
--no-summa|--no-summar|--no-summary)
no_summary=-n ;;
--summary)
no_summary=$1
;;
--no-c|--no-co|--no-com|--no-comm|--no-commi|--no-commit)
no_commit=--no-commit ;;
--sq|--squ|--squa|--squas|--squash)
Expand Down

0 comments on commit 8250465

Please sign in to comment.