Skip to content

Commit eed5556

Browse files
committed
Merge 'pull-rebase-interactive' into HEAD
2 parents 40d26cd + 69eed0b commit eed5556

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
@@ -812,6 +812,7 @@ branch.<name>.rebase::
812812
instead of merging the default branch from the default remote when
813813
"git pull" is run. See "pull.rebase" for doing this in a non
814814
branch-specific manner.
815+
When the value is `interactive`, the rebase is run in interactive mode.
815816
+
816817
When preserve, also pass `--preserve-merges` along to 'git rebase'
817818
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
@@ -104,7 +104,7 @@ Options related to merging
104104
include::merge-options.txt[]
105105

106106
-r::
107-
--rebase[=false|true|preserve]::
107+
--rebase[=false|true|preserve|interactive]::
108108
When true, rebase the current branch on top of the upstream
109109
branch after fetching. If there is a remote-tracking branch
110110
corresponding to the upstream branch and the upstream branch
@@ -117,6 +117,8 @@ locally created merge commits will not be flattened.
117117
+
118118
When false, merge the current branch into the upstream branch.
119119
+
120+
When `interactive`, enable the interactive mode of rebase.
121+
+
120122
See `pull.rebase`, `branch.<name>.rebase` and `branch.autosetuprebase` in
121123
linkgit:git-config[1] if you want to make `git pull` always use
122124
`--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;
@@ -1000,7 +1002,9 @@ static int show_local_info_item(struct string_list_item *item, void *cb_data)
10001002

10011003
printf(" %-*s ", show_info->width, item->string);
10021004
if (branch_info->rebase) {
1003-
printf_ln(_("rebases onto remote %s"), merge->items[0].string);
1005+
printf_ln(_(branch_info->rebase == INTERACTIVE_REBASE ?
1006+
"rebases interactively onto remote %s" :
1007+
"rebases onto remote %s"), merge->items[0].string);
10041008
return 0;
10051009
} else if (show_info->any_rebase) {
10061010
printf_ln(_(" merges with remote %s"), merge->items[0].string);

git-pull.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ do
135135
;;
136136
--no-r|--no-re|--no-reb|--no-reba|--no-rebas|--no-rebase)
137137
rebase=false
138+
138139
;;
139140
--recurse-submodules)
140141
recurse_submodules=--recurse-submodules
@@ -175,14 +176,18 @@ do
175176
done
176177

177178
case "$rebase" in
179+
i|interactive)
180+
rebase=true
181+
rebase_args=-i
182+
;;
178183
preserve)
179184
rebase=true
180185
rebase_args=--preserve-merges
181186
;;
182187
true|false|'')
183188
;;
184189
*)
185-
echo "Invalid value for --rebase, should be true, false, or preserve"
190+
echo "Invalid value for --rebase, should be true, false, interactive or preserve"
186191
usage
187192
exit 1
188193
;;

0 commit comments

Comments
 (0)