Merge branch 'ds/rebase-update-ref'
"git rebase -i" learns to update branches whose tip appear in the rebased range with "--update-refs" option. source: <pull.1247.v5.git.1658255624.gitgitgadget@gmail.com> * ds/rebase-update-ref: sequencer: notify user of --update-refs activity sequencer: ignore HEAD ref under --update-refs rebase: add rebase.updateRefs config option sequencer: rewrite update-refs as user edits todo list rebase: update refs from 'update-ref' commands rebase: add --update-refs option sequencer: add update-ref command sequencer: define array with enum values rebase-interactive: update 'merge' description branch: consider refs under 'update-refs' t2407: test branches currently using apply backend t2407: test bisect and rebase as black-boxes
This commit is contained in:
@ -102,6 +102,7 @@ struct rebase_options {
|
||||
int reschedule_failed_exec;
|
||||
int reapply_cherry_picks;
|
||||
int fork_point;
|
||||
int update_refs;
|
||||
};
|
||||
|
||||
#define REBASE_OPTIONS_INIT { \
|
||||
@ -298,6 +299,7 @@ static int do_interactive_rebase(struct rebase_options *opts, unsigned flags)
|
||||
ret = complete_action(the_repository, &replay, flags,
|
||||
shortrevisions, opts->onto_name, opts->onto,
|
||||
&opts->orig_head, &commands, opts->autosquash,
|
||||
opts->update_refs,
|
||||
&todo_list);
|
||||
}
|
||||
|
||||
@ -800,6 +802,11 @@ static int rebase_config(const char *var, const char *value, void *data)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!strcmp(var, "rebase.updaterefs")) {
|
||||
opts->update_refs = git_config_bool(var, value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!strcmp(var, "rebase.reschedulefailedexec")) {
|
||||
opts->reschedule_failed_exec = git_config_bool(var, value);
|
||||
return 0;
|
||||
@ -1124,6 +1131,9 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
|
||||
OPT_BOOL(0, "autosquash", &options.autosquash,
|
||||
N_("move commits that begin with "
|
||||
"squash!/fixup! under -i")),
|
||||
OPT_BOOL(0, "update-refs", &options.update_refs,
|
||||
N_("update branches that point to commits "
|
||||
"that are being rebased")),
|
||||
{ OPTION_STRING, 'S', "gpg-sign", &gpg_sign, N_("key-id"),
|
||||
N_("GPG-sign commits"),
|
||||
PARSE_OPT_OPTARG, NULL, (intptr_t) "" },
|
||||
|
Reference in New Issue
Block a user