Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit 8746a0e

Browse files
committed
Merge 'pull-rebase-interactive' into HEAD
2 parents cd247ad + 12c7600 commit 8746a0e

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
@@ -774,6 +774,7 @@ branch.<name>.rebase::
774774
instead of merging the default branch from the default remote when
775775
"git pull" is run. See "pull.rebase" for doing this in a non
776776
branch-specific manner.
777+
When the value is `interactive`, the rebase is run in interactive mode.
777778
+
778779
When preserve, also pass `--preserve-merges` along to 'git rebase'
779780
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
@@ -243,7 +243,7 @@ static int add(int argc, const char **argv)
243243
struct branch_info {
244244
char *remote_name;
245245
struct string_list merge;
246-
int rebase;
246+
enum { NO_REBASE, NORMAL_REBASE, INTERACTIVE_REBASE } rebase;
247247
};
248248

249249
static struct string_list branch_list;
@@ -305,6 +305,8 @@ static int config_read_branches(const char *key, const char *value, void *cb)
305305
info->rebase = v;
306306
else if (!strcmp(value, "preserve"))
307307
info->rebase = 1;
308+
else if (!strcmp(value, "interactive"))
309+
info->rebase = INTERACTIVE_REBASE;
308310
}
309311
}
310312
return 0;
@@ -990,7 +992,9 @@ static int show_local_info_item(struct string_list_item *item, void *cb_data)
990992

991993
printf(" %-*s ", show_info->width, item->string);
992994
if (branch_info->rebase) {
993-
printf_ln(_("rebases onto remote %s"), merge->items[0].string);
995+
printf_ln(_(branch_info->rebase == INTERACTIVE_REBASE ?
996+
"rebases interactively onto remote %s" :
997+
"rebases onto remote %s"), merge->items[0].string);
994998
return 0;
995999
} else if (show_info->any_rebase) {
9961000
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
@@ -137,6 +137,7 @@ do
137137
;;
138138
--no-r|--no-re|--no-reb|--no-reba|--no-rebas|--no-rebase)
139139
rebase=false
140+
140141
;;
141142
--recurse-submodules)
142143
recurse_submodules=--recurse-submodules
@@ -177,14 +178,18 @@ do
177178
done
178179

179180
case "$rebase" in
181+
i|interactive)
182+
rebase=true
183+
rebase_args=-i
184+
;;
180185
preserve)
181186
rebase=true
182187
rebase_args=--preserve-merges
183188
;;
184189
true|false|'')
185190
;;
186191
*)
187-
echo "Invalid value for --rebase, should be true, false, or preserve"
192+
echo "Invalid value for --rebase, should be true, false, interactive or preserve"
188193
usage
189194
exit 1
190195
;;

0 commit comments

Comments
 (0)