Skip to content

Commit 9efa9a7

Browse files
committed
Merge 'pull-rebase-interactive' into HEAD
2 parents a551588 + b09e2f6 commit 9efa9a7

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
@@ -245,7 +245,7 @@ static int add(int argc, const char **argv)
245245
struct branch_info {
246246
char *remote_name;
247247
struct string_list merge;
248-
int rebase;
248+
enum { NO_REBASE, NORMAL_REBASE, INTERACTIVE_REBASE } rebase;
249249
};
250250

251251
static struct string_list branch_list;
@@ -306,6 +306,8 @@ static int config_read_branches(const char *key, const char *value, void *cb)
306306
info->rebase = v;
307307
else if (!strcmp(value, "preserve"))
308308
info->rebase = 1;
309+
else if (!strcmp(value, "interactive"))
310+
info->rebase = INTERACTIVE_REBASE;
309311
}
310312
}
311313
return 0;
@@ -974,7 +976,9 @@ static int show_local_info_item(struct string_list_item *item, void *cb_data)
974976

975977
printf(" %-*s ", show_info->width, item->string);
976978
if (branch_info->rebase) {
977-
printf_ln(_("rebases onto remote %s"), merge->items[0].string);
979+
printf_ln(_(branch_info->rebase == INTERACTIVE_REBASE ?
980+
"rebases interactively onto remote %s" :
981+
"rebases onto remote %s"), merge->items[0].string);
978982
return 0;
979983
} else if (show_info->any_rebase) {
980984
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)