From: Junio C Hamano Date: Wed, 11 Mar 2009 20:49:11 +0000 (-0700) Subject: Merge branch 'tv/rebase-stat' X-Git-Tag: v1.6.3-rc0~172 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/e43997979ecc69bb9b9720a080a3897738e00f19?hp=-c 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 --- e43997979ecc69bb9b9720a080a3897738e00f19 diff --combined Documentation/config.txt index 300ab25dcf,6be2e9935b..56bd781a16 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@@ -677,16 -677,6 +677,16 @@@ format.pretty: See linkgit:git-log[1], linkgit:git-show[1], linkgit:git-whatchanged[1]. +format.thread:: + The default threading style for 'git-format-patch'. Can be + either a boolean value, `shallow` or `deep`. 'Shallow' + threading makes every mail a reply to the head of the series, + where the head is chosen from the cover letter, the + `\--in-reply-to`, and the first patch mail, in this order. + 'Deep' threading makes every mail a reply to the previous one. + A true boolean value is the same as `shallow`, and a false + value disables threading. + gc.aggressiveWindow:: The window size parameter used in the delta compression algorithm used by 'git-gc --aggressive'. This defaults @@@ -1170,6 -1160,10 +1170,10 @@@ pull.octopus: pull.twohead:: The default merge strategy to use when pulling a single branch. + rebase.stat:: + Whether to show a diffstat of what changed upstream since the last + rebase. False by default. + receive.fsckObjects:: If it is set to true, git-receive-pack will check all received objects. It will abort in the case of a malformed object or a diff --combined git-rebase.sh index c2a9b1fbe0,26d75662f9..d38ab0b83f --- a/git-rebase.sh +++ b/git-rebase.sh @@@ -3,7 -3,7 +3,7 @@@ # Copyright (c) 2005 Junio C Hamano. # -USAGE='[--interactive | -i] [-v] [--onto ] [|--root] []' +USAGE='[--interactive | -i] [-v] [--force-rebase | -f] [--onto ] [|--root] []' LONG_USAGE='git-rebase replaces with a new branch of the same name. When the --onto option is provided the new branch starts out with a HEAD equal to , otherwise it is equal to @@@ -46,9 -46,9 +46,10 @@@ do_merge dotest="$GIT_DIR"/rebase-merge prec=4 verbose= + diffstat=$(git config --bool rebase.stat) git_am_opt= rebase_root= +force_rebase= continue_merge () { test -n "$prev_head" || die "prev_head must be defined" @@@ -290,16 -290,18 +291,23 @@@ d 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" + case "$1" in + --whitespace=fix|--whitespace=strip) + force_rebase=t + ;; + esac ;; -C*) git_am_opt="$git_am_opt $1" @@@ -307,9 -309,6 +315,9 @@@ --root) rebase_root=t ;; + -f|--f|--fo|--for|--forc|force|--force-r|--force-re|--force-reb|--force-reba|--force_rebas|--force-rebase) + force_rebase=t + ;; -*) usage ;; @@@ -429,29 -428,27 +437,32 @@@ if test "$upstream" = "$onto" && test " # linear history? ! (git rev-list --parents "$onto".."$branch" | grep " .* ") > /dev/null then - # Lazily switch to the target branch if needed... - test -z "$switch_to" || git checkout "$switch_to" - echo >&2 "Current branch $branch_name is up to date." - exit 0 + if test -z "$force_rebase" + then + # Lazily switch to the target branch if needed... + test -z "$switch_to" || git checkout "$switch_to" + echo >&2 "Current branch $branch_name is up to date." + exit 0 + else + echo "Current branch $branch_name is up to date, rebase forced." + 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"