summaryrefslogtreecommitdiff
path: root/sequencer.h
diff options
context:
space:
mode:
authorDerrick Stolee <derrickstolee@github.com>2022-07-19 18:33:39 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-07-19 19:49:04 (GMT)
commit900b50c242dfa6b47033cbb495d2fd9d06752ff1 (patch)
treef1c4440f77ca55f9d476d17c8b8e126864ad5fa4 /sequencer.h
parenta97d79163e16e2d3777ab4d86c8f006f260c2836 (diff)
downloadgit-900b50c242dfa6b47033cbb495d2fd9d06752ff1.zip
git-900b50c242dfa6b47033cbb495d2fd9d06752ff1.tar.gz
git-900b50c242dfa6b47033cbb495d2fd9d06752ff1.tar.bz2
rebase: add --update-refs option
When working on a large feature, it can be helpful to break that feature into multiple smaller parts that become reviewed in sequence. During development or during review, a change to one part of the feature could affect multiple of these parts. An interactive rebase can help adjust the multi-part "story" of the branch. However, if there are branches tracking the different parts of the feature, then rebasing the entire list of commits can create commits not reachable from those "sub branches". It can take a manual step to update those branches. Add a new --update-refs option to 'git rebase -i' that adds 'update-ref <ref>' steps to the todo file whenever a commit that is being rebased is decorated with that <ref>. At the very end, the rebase process updates all of the listed refs to the values stored during the rebase operation. Be sure to iterate after any squashing or fixups are placed. Update the branch only after those squashes and fixups are complete. This allows a --fixup commit at the tip of the feature to apply correctly to the sub branch, even if it is fixing up the most-recent commit in that part. This change update the documentation and builtin to accept the --update-refs option as well as updating the todo file with the 'update-ref' commands. Tests are added to ensure that these todo commands are added in the correct locations. This change does _not_ include the actual behavior of tracking the updated refs and writing the new ref values at the end of the rebase process. That is deferred to a later change. Signed-off-by: Derrick Stolee <derrickstolee@github.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sequencer.h')
-rw-r--r--sequencer.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sequencer.h b/sequencer.h
index d87feae..8216b62 100644
--- a/sequencer.h
+++ b/sequencer.h
@@ -168,6 +168,7 @@ int complete_action(struct repository *r, struct replay_opts *opts, unsigned fla
const char *shortrevisions, const char *onto_name,
struct commit *onto, const struct object_id *orig_head,
struct string_list *commands, unsigned autosquash,
+ unsigned update_refs,
struct todo_list *todo_list);
int todo_list_rearrange_squash(struct todo_list *todo_list);