Skip to content

Commit 4aa8b8c

Browse files
committed
Teach 'git pull' to handle --rebase=interactive
Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 7b316a4 commit 4aa8b8c

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

Documentation/git-pull.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,16 @@ include::merge-options.txt[]
101101

102102
:git-pull: 1
103103

104-
--rebase::
104+
--rebase[=interactive]::
105105
Rebase the current branch on top of the upstream branch after
106106
fetching. If there is a remote-tracking branch corresponding to
107107
the upstream branch and the upstream branch was rebased since last
108108
fetched, the rebase uses that information to avoid rebasing
109109
non-local changes.
110110
+
111+
The optional mode `interactive` tells Git to switch on rebase's interactive
112+
mode.
113+
+
111114
See `branch.<name>.rebase` and `branch.autosetuprebase` in
112115
linkgit:git-config[1] if you want to make `git pull` always use
113116
`{litdd}rebase` instead of merging.

git-pull.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ log_arg= verbosity= progress= recurse_submodules=
4343
merge_args=
4444
curr_branch=$(git symbolic-ref -q HEAD)
4545
curr_branch_short="${curr_branch#refs/heads/}"
46+
rebase_options=
4647
rebase=$(git config --bool branch.$curr_branch_short.rebase)
4748
dry_run=
4849
while :
@@ -105,7 +106,12 @@ do
105106
-r|--r|--re|--reb|--reba|--rebas|--rebase)
106107
rebase=true
107108
;;
109+
--rebase=i|--rebase=interactive)
110+
rebase_options=-i
111+
rebase=true
112+
;;
108113
--no-r|--no-re|--no-reb|--no-reba|--no-rebas|--no-rebase)
114+
rebase_options=
109115
rebase=false
110116
;;
111117
--recurse-submodules)
@@ -270,7 +276,7 @@ fi
270276
merge_name=$(git fmt-merge-msg $log_arg <"$GIT_DIR/FETCH_HEAD") || exit
271277
case "$rebase" in
272278
true)
273-
eval="git-rebase $diffstat $strategy_args $merge_args"
279+
eval="git-rebase $rebase_options $diffstat $strategy_args $merge_args"
274280
eval="$eval --onto $merge_head ${oldremoteref:-$merge_head}"
275281
;;
276282
*)

0 commit comments

Comments
 (0)