From: Elijah Newren Date: Sat, 16 Jul 2022 19:20:23 GMT Subject: Re: [PATCH v4 09/12] sequencer: rewrite update-refs as user edits todo list Message-ID: In-Reply-To: <29c7c76805abb9b8afd44a65cb39d8f9d3c95892.1657631226.git.gitgitgadget@gmail.com> On Tue, Jul 12, 2022 at 6:07 AM Derrick Stolee via GitGitGadget wrote: > > From: Derrick Stolee > > An interactive rebase provides opportunities for the user to edit the > todo list. The --update-refs option initializes the list with some > 'update-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 '//' triple in the update-refs file does not > have a matching 'update-ref ' command in the todo-list _and_ the > value is the null OID, then remove that triple. Here, the > user removed the 'update-ref ' command before it was executed, > since if it was executed then the value would store the > commit at that position. > > 2. If a 'update-ref ' command in the todo-list does not have a > matching '//' triple in the update-refs file, > then insert a new one. Store the value to be the current > OID pointed at by . 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/ ?