Re: [PATCH v4 09/12] sequencer: rewrite update-refs as user edits todo list
- From
Elijah Newren <newren@gmail.com>
- Date
- Jul 16, 2022, 19:20 UTC
- Message-ID
- <CABPp-BF_F3X4ZMQpV7DRkt-ZzLS2erMKHJAbL6s2eQRxahEg=Q@mail.gmail.com>
- In-Reply-To
- <29c7c76805abb9b8afd44a65cb39d8f9d3c95892.1657631226.git.gitgitgadget@gmail.com>
On Tue, Jul 12, 2022 at 6:07 AM Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com> wrote:
Show 29 quoted lines
> > From: Derrick Stolee <derrickstolee@github.com> > > An interactive rebase provides opportunities for the user to edit the > todo list. The --update-refs option initializes the list with some > 'update-ref <ref>' steps, but the user could add these manually. > Further, the user could add or remove these steps during pauses in the > interactive rebase. > > Add a new method, todo_list_filter_update_refs(), that scans a todo_list > and compares it to the stored update-refs file. There are two actions > that can happen at this point: > > 1. If a '<ref>/<before>/<after>' triple in the update-refs file does not > have a matching 'update-ref <ref>' command in the todo-list _and_ the > <after> value is the null OID, then remove that triple. Here, the > user removed the 'update-ref <ref>' command before it was executed, > since if it was executed then the <after> value would store the > commit at that position. > > 2. If a 'update-ref <ref>' command in the todo-list does not have a > matching '<ref>/<before>/<after>' triple in the update-refs file, > then insert a new one. Store the <before> value to be the current > OID pointed at by <ref>. This is handled inside of the > init_update_ref_record() helper method. > > We can test that this works by rewriting the todo-list several times in > the course of a rebase. Check that each ref is locked or unlocked for > updates after each todo-list update. We an also verify that the ref
s/an/can/ ?