From c26caa0faea8d3dcb9301ccf2ceadd9f36f245af Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Fri, 21 Oct 2011 23:27:09 -0500 Subject: [PATCH] Teach 'git pull' to handle --rebase=interactive Signed-off-by: Johannes Schindelin --- Documentation/git-pull.txt | 5 ++++- git-pull.sh | 8 +++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Documentation/git-pull.txt b/Documentation/git-pull.txt index 0f18ec891a..a5506a83c5 100644 --- a/Documentation/git-pull.txt +++ b/Documentation/git-pull.txt @@ -101,13 +101,16 @@ include::merge-options.txt[] :git-pull: 1 ---rebase:: +--rebase[=interactive]:: Rebase the current branch on top of the upstream branch after fetching. If there is a remote-tracking branch corresponding to the upstream branch and the upstream branch was rebased since last fetched, the rebase uses that information to avoid rebasing non-local changes. + +The optional mode `interactive` tells Git to switch on rebase's interactive +mode. ++ See `pull.rebase`, `branch..rebase` and `branch.autosetuprebase` in linkgit:git-config[1] if you want to make `git pull` always use `{litdd}rebase` instead of merging. diff --git a/git-pull.sh b/git-pull.sh index d8b64d7a67..50f4855117 100755 --- a/git-pull.sh +++ b/git-pull.sh @@ -43,6 +43,7 @@ log_arg= verbosity= progress= recurse_submodules= merge_args= curr_branch=$(git symbolic-ref -q HEAD) curr_branch_short="${curr_branch#refs/heads/}" +rebase_options= rebase=$(git config --bool branch.$curr_branch_short.rebase) if test -z "$rebase" then @@ -109,7 +110,12 @@ do -r|--r|--re|--reb|--reba|--rebas|--rebase) rebase=true ;; + --rebase=i|--rebase=interactive) + rebase_options=-i + rebase=true + ;; --no-r|--no-re|--no-reb|--no-reba|--no-rebas|--no-rebase) + rebase_options= rebase=false ;; --recurse-submodules) @@ -274,7 +280,7 @@ fi merge_name=$(git fmt-merge-msg $log_arg <"$GIT_DIR/FETCH_HEAD") || exit case "$rebase" in true) - eval="git-rebase $diffstat $strategy_args $merge_args" + eval="git-rebase $rebase_options $diffstat $strategy_args $merge_args" eval="$eval --onto $merge_head ${oldremoteref:-$merge_head}" ;; *) -- 2.11.4.GIT