Merge 'pull-rebase-interactive' into HEAD

This commit is contained in:
Johannes Schindelin
2014-05-10 16:57:00 -05:00
4 changed files with 16 additions and 4 deletions

View File

@@ -775,6 +775,7 @@ branch.<name>.rebase::
instead of merging the default branch from the default remote when
"git pull" is run. See "pull.rebase" for doing this in a non
branch-specific manner.
When the value is `interactive`, the rebase is run in interactive mode.
+
When preserve, also pass `--preserve-merges` along to 'git rebase'
so that locally committed merge commits will not be flattened

View File

@@ -104,7 +104,7 @@ Options related to merging
include::merge-options.txt[]
-r::
--rebase[=false|true|preserve]::
--rebase[=false|true|preserve|interactive]::
When true, rebase the current branch on top of the upstream
branch after fetching. If there is a remote-tracking branch
corresponding to the upstream branch and the upstream branch
@@ -117,6 +117,8 @@ locally created merge commits will not be flattened.
+
When false, merge the current branch into the upstream branch.
+
When `interactive`, enable the interactive mode of rebase.
+
See `pull.rebase`, `branch.<name>.rebase` and `branch.autosetuprebase` in
linkgit:git-config[1] if you want to make `git pull` always use
`--rebase` instead of merging.

View File

@@ -243,7 +243,7 @@ static int add(int argc, const char **argv)
struct branch_info {
char *remote_name;
struct string_list merge;
int rebase;
enum { NO_REBASE, NORMAL_REBASE, INTERACTIVE_REBASE } rebase;
};
static struct string_list branch_list;
@@ -305,6 +305,8 @@ static int config_read_branches(const char *key, const char *value, void *cb)
info->rebase = v;
else if (!strcmp(value, "preserve"))
info->rebase = 1;
else if (!strcmp(value, "interactive"))
info->rebase = INTERACTIVE_REBASE;
}
}
return 0;
@@ -990,7 +992,9 @@ static int show_local_info_item(struct string_list_item *item, void *cb_data)
printf(" %-*s ", show_info->width, item->string);
if (branch_info->rebase) {
printf_ln(_("rebases onto remote %s"), merge->items[0].string);
printf_ln(_(branch_info->rebase == INTERACTIVE_REBASE ?
"rebases interactively onto remote %s" :
"rebases onto remote %s"), merge->items[0].string);
return 0;
} else if (show_info->any_rebase) {
printf_ln(_(" merges with remote %s"), merge->items[0].string);

View File

@@ -122,6 +122,7 @@ do
;;
--no-r|--no-re|--no-reb|--no-reba|--no-rebas|--no-rebase)
rebase=false
;;
--recurse-submodules)
recurse_submodules=--recurse-submodules
@@ -153,6 +154,10 @@ do
done
case "$rebase" in
i|interactive)
rebase=true
rebase_args=-i
;;
preserve)
rebase=true
rebase_args=--preserve-merges
@@ -160,7 +165,7 @@ preserve)
true|false|'')
;;
*)
echo "Invalid value for --rebase, should be true, false, or preserve"
echo "Invalid value for --rebase, should be true, false, interactive or preserve"
usage
exit 1
;;