summaryrefslogtreecommitdiff
path: root/git-rebase.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-03-11 13:49:11 -0700
committerJunio C Hamano <gitster@pobox.com>2009-03-11 13:49:11 -0700
commite43997979ecc69bb9b9720a080a3897738e00f19 (patch)
treebb3885fa10e746a64b7ac7781fd4c51828842f4f /git-rebase.sh
parent8a396c02fdc7efa787be20074ae08059e3f80d14 (diff)
parenta334e1254c0c2d55f20b271872fbac9a6a67218b (diff)
downloadgit-e43997979ecc69bb9b9720a080a3897738e00f19.tar.gz
Merge branch 'tv/rebase-stat'
* tv/rebase-stat: git-pull: Allow --stat and --no-stat to be used with --rebase git-rebase: Add --stat and --no-stat for producing diffstat on rebase
Diffstat (limited to 'git-rebase.sh')
-rwxr-xr-xgit-rebase.sh25
1 files changed, 18 insertions, 7 deletions
diff --git a/git-rebase.sh b/git-rebase.sh
index c2a9b1fbe0..d38ab0b83f 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -46,6 +46,7 @@ do_merge=
dotest="$GIT_DIR"/rebase-merge
prec=4
verbose=
+diffstat=$(git config --bool rebase.stat)
git_am_opt=
rebase_root=
force_rebase=
@@ -290,8 +291,15 @@ do
esac
do_merge=t
;;
+ -n|--no-stat)
+ diffstat=
+ ;;
+ --stat)
+ diffstat=t
+ ;;
-v|--verbose)
verbose=t
+ diffstat=t
;;
--whitespace=*)
git_am_opt="$git_am_opt $1"
@@ -440,18 +448,21 @@ then
fi
fi
-if test -n "$verbose"
-then
- echo "Changes from $mb to $onto:"
- # We want color (if set), but no pager
- GIT_PAGER='' git diff --stat --summary "$mb" "$onto"
-fi
-
# Detach HEAD and reset the tree
echo "First, rewinding head to replay your work on top of it..."
git checkout -q "$onto^0" || die "could not detach HEAD"
git update-ref ORIG_HEAD $branch
+if test -n "$diffstat"
+then
+ if test -n "$verbose"
+ then
+ echo "Changes from $mb to $onto:"
+ fi
+ # We want color (if set), but no pager
+ GIT_PAGER='' git diff --stat --summary "$mb" "$onto"
+fi
+
# If the $onto is a proper descendant of the tip of the branch, then
# we just fast forwarded.
if test "$mb" = "$branch"