git-rebase: Add a -v option to show a diffstat of the changes upstream at the start of a rebase.
Signed-off-by: Robert Shearman <rob@codeweavers.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
Robert Shearman committed
Oct 3, 2006 at 17:29 UTC
b758789c202dc491555b698149afe4d4941f7cd5
2 files changed
+15
-2
Documentation/git-rebase.txt
+4
-1
@@ -7,7 +7,7 @@ git-rebase - Rebase local commits to a new head
7
8
SYNOPSIS
9
--------
10
-'git-rebase' [--merge] [--onto <newbase>] <upstream> [<branch>]
10
+'git-rebase' [-v] [--merge] [--onto <newbase>] <upstream> [<branch>]
11
12
'git-rebase' --continue | --skip | --abort
13
@@ -121,6 +121,9 @@ OPTIONS
121
is used instead (`git-merge-recursive` when merging a single
122
head, `git-merge-octopus` otherwise). This implies --merge.
123
124
+-v, \--verbose::
125
+ Display a diffstat of what changed upstream since the last rebase.
126
+
127
include::merge-strategies.txt[]
128
129
NOTES
git-rebase.sh
+11
-1
@@ -3,7 +3,7 @@
3
# Copyright (c) 2005 Junio C Hamano.
4
#
5
6
-USAGE='[--onto <newbase>] <upstream> [<branch>]'
6
+USAGE='[-v] [--onto <newbase>] <upstream> [<branch>]'
7
LONG_USAGE='git-rebase replaces <branch> with a new branch of the
8
same name. When the --onto option is provided the new branch starts
9
out with a HEAD equal to <newbase>, otherwise it is equal to <upstream>
@@ -39,6 +39,7 @@ strategy=recursive
39
do_merge=
40
dotest=$GIT_DIR/.dotest-merge
41
prec=4
42
+verbose=
43
44
continue_merge () {
45
test -n "$prev_head" || die "prev_head must be defined"
@@ -190,6 +191,9 @@ do
191
esac
192
do_merge=t
193
;;
194
+ -v|--verbose)
195
+ verbose=t
196
+ ;;
197
-*)
198
usage
199
;;
@@ -273,6 +277,12 @@ then
277
exit 0
278
fi
279
280
+if test -n "$verbose"
281
+then
282
+ echo "Changes from $mb to $onto:"
283
+ git-diff-tree --stat --summary "$mb" "$onto"
284
+fi
285
+
286
# Rewind the head to "$onto"; this saves our current head in ORIG_HEAD.
287
git-reset --hard "$onto"
288