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

Commit f7a9918

Browse files
committed
Merge 'pull-rebase-interactive' into HEAD
2 parents a9586f2 + bf5519e commit f7a9918

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
@@ -782,6 +782,7 @@ branch.<name>.rebase::
782782
instead of merging the default branch from the default remote when
783783
"git pull" is run. See "pull.rebase" for doing this in a non
784784
branch-specific manner.
785+
When the value is `interactive`, the rebase is run in interactive mode.
785786
+
786787
When preserve, also pass `--preserve-merges` along to 'git rebase'
787788
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;
@@ -304,6 +304,8 @@ static int config_read_branches(const char *key, const char *value, void *cb)
304304
info->rebase = v;
305305
else if (!strcmp(value, "preserve"))
306306
info->rebase = 1;
307+
else if (!strcmp(value, "interactive"))
308+
info->rebase = INTERACTIVE_REBASE;
307309
}
308310
}
309311
return 0;
@@ -999,7 +1001,9 @@ static int show_local_info_item(struct string_list_item *item, void *cb_data)
9991001

10001002
printf(" %-*s ", show_info->width, item->string);
10011003
if (branch_info->rebase) {
1002-
printf_ln(_("rebases onto remote %s"), merge->items[0].string);
1004+
printf_ln(_(branch_info->rebase == INTERACTIVE_REBASE ?
1005+
"rebases interactively onto remote %s" :
1006+
"rebases onto remote %s"), merge->items[0].string);
10031007
return 0;
10041008
} else if (show_info->any_rebase) {
10051009
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)