Skip to content

Commit d97cfc2

Browse files
committed
Merge 'pull-rebase-interactive' into HEAD
2 parents f0922a0 + 7b62dae commit d97cfc2

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

Documentation/config.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -871,6 +871,7 @@ branch.<name>.rebase::
871871
instead of merging the default branch from the default remote when
872872
"git pull" is run. See "pull.rebase" for doing this in a non
873873
branch-specific manner.
874+
When the value is `interactive`, the rebase is run in interactive mode.
874875
+
875876
When preserve, also pass `--preserve-merges` along to 'git rebase'
876877
so that locally committed merge commits will not be flattened

Documentation/git-pull.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ Options related to merging
101101
include::merge-options.txt[]
102102

103103
-r::
104-
--rebase[=false|true|preserve]::
104+
--rebase[=false|true|preserve|interactive]::
105105
When true, rebase the current branch on top of the upstream
106106
branch after fetching. If there is a remote-tracking branch
107107
corresponding to the upstream branch and the upstream branch
@@ -113,6 +113,8 @@ to `git rebase` so that locally created merge commits will not be flattened.
113113
+
114114
When false, merge the current branch into the upstream branch.
115115
+
116+
When `interactive`, enable the interactive mode of rebase.
117+
+
116118
See `pull.rebase`, `branch.<name>.rebase` and `branch.autoSetupRebase` in
117119
linkgit:git-config[1] if you want to make `git pull` always use
118120
`--rebase` instead of merging.

builtin/remote.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ static int add(int argc, const char **argv)
251251
struct branch_info {
252252
char *remote_name;
253253
struct string_list merge;
254-
int rebase;
254+
enum { NO_REBASE, NORMAL_REBASE, INTERACTIVE_REBASE } rebase;
255255
};
256256

257257
static struct string_list branch_list;
@@ -312,6 +312,8 @@ static int config_read_branches(const char *key, const char *value, void *cb)
312312
info->rebase = v;
313313
else if (!strcmp(value, "preserve"))
314314
info->rebase = 1;
315+
else if (!strcmp(value, "interactive"))
316+
info->rebase = INTERACTIVE_REBASE;
315317
}
316318
}
317319
return 0;
@@ -980,7 +982,9 @@ static int show_local_info_item(struct string_list_item *item, void *cb_data)
980982

981983
printf(" %-*s ", show_info->width, item->string);
982984
if (branch_info->rebase) {
983-
printf_ln(_("rebases onto remote %s"), merge->items[0].string);
985+
printf_ln(_(branch_info->rebase == INTERACTIVE_REBASE ?
986+
"rebases interactively onto remote %s" :
987+
"rebases onto remote %s"), merge->items[0].string);
984988
return 0;
985989
} else if (show_info->any_rebase) {
986990
printf_ln(_(" merges with remote %s"), merge->items[0].string);

contrib/examples/git-pull.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ do
159159
;;
160160
--no-rebase)
161161
rebase=false
162+
162163
;;
163164
--recurse-submodules)
164165
recurse_submodules=--recurse-submodules
@@ -224,14 +225,18 @@ do
224225
done
225226

226227
case "$rebase" in
228+
i|interactive)
229+
rebase=true
230+
rebase_args=-i
231+
;;
227232
preserve)
228233
rebase=true
229234
rebase_args=--preserve-merges
230235
;;
231236
true|false|'')
232237
;;
233238
*)
234-
echo "Invalid value for --rebase, should be true, false, or preserve"
239+
echo "Invalid value for --rebase, should be true, false, interactive or preserve"
235240
usage
236241
exit 1
237242
;;

0 commit comments

Comments
 (0)