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
This commit is contained in:
Junio C Hamano
2009-03-11 13:49:11 -07:00
5 changed files with 65 additions and 14 deletions

View File

@ -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"