]> git.ipfire.org Git - thirdparty/git.git/blobdiff - sequencer.h
ls-tree: fold "show_tree_data" into "cb" struct
[thirdparty/git.git] / sequencer.h
index 698599fe4e915ed4acbbf17995b0df201b723321..888c18aad7188e48985eb5c994b13853dc30c137 100644 (file)
@@ -63,6 +63,9 @@ struct replay_opts {
        char **xopts;
        size_t xopts_nr, xopts_alloc;
 
+       /* Reflog */
+       char *reflog_action;
+
        /* Used by fixup/squash */
        struct strbuf current_fixups;
        int current_fixup_count;
@@ -73,6 +76,9 @@ struct replay_opts {
 
        /* Only used by REPLAY_NONE */
        struct rev_info *revs;
+
+       /* Private use */
+       const char *reflog_message;
 };
 #define REPLAY_OPTS_INIT { .edit = -1, .action = -1, .current_fixups = STRBUF_INIT }
 
@@ -96,6 +102,7 @@ enum todo_command {
        TODO_LABEL,
        TODO_RESET,
        TODO_MERGE,
+       TODO_UPDATE_REF,
        /* commands that do nothing but are counted for reporting progress */
        TODO_NOOP,
        TODO_DROP,
@@ -132,6 +139,18 @@ void todo_list_release(struct todo_list *todo_list);
 const char *todo_item_get_arg(struct todo_list *todo_list,
                              struct todo_item *item);
 
+/*
+ * Parse the update-refs file for the current rebase, then remove the
+ * refs that do not appear in the todo_list (and have not had updated
+ * values stored) and add refs that are in the todo_list but not
+ * represented in the update-refs file.
+ *
+ * If there are changes to the update-refs list, then write the new state
+ * to disk.
+ */
+void todo_list_filter_update_refs(struct repository *r,
+                                 struct todo_list *todo_list);
+
 /* Call this to setup defaults before parsing command line options */
 void sequencer_init_config(struct replay_opts *opts);
 int sequencer_pick_revisions(struct repository *repo,
@@ -167,6 +186,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);
 
@@ -233,4 +253,13 @@ void sequencer_post_commit_cleanup(struct repository *r, int verbose);
 int sequencer_get_last_command(struct repository* r,
                               enum replay_action *action);
 int sequencer_determine_whence(struct repository *r, enum commit_whence *whence);
+
+/**
+ * Append the set of ref-OID pairs that are currently stored for the 'git
+ * rebase --update-refs' feature if such a rebase is currently happening.
+ *
+ * Localized to a worktree's git dir.
+ */
+int sequencer_get_update_refs_state(const char *wt_dir, struct string_list *refs);
+
 #endif /* SEQUENCER_H */