From: Junio C Hamano Date: Tue, 07 Jun 2022 22:23:08 GMT Subject: Re: [PATCH v2 6/7] sequencer: implement 'update-refs' command Message-ID: In-Reply-To: <68f8e51b19c024e1cb075dffd07f81cceaba5957.1654634569.git.gitgitgadget@gmail.com> "Derrick Stolee via GitGitGadget" writes: > From: Derrick Stolee > > The previous change allowed 'git rebase --update-refs' to create 'label' > commands for each branch among the commits being rewritten and add an > 'update-refs' command at the end of the todo list. Now, teach Git to > update the refs during that final 'update-refs' command. > > We need to create an array of new and old OIDs for each ref by iterating > over the refs/rewritten/for-update-refs/ namespace. We cannot update the > refs in-place since this will confuse the refs iterator. In other words, grab everything we need to do and then use that in-core information to tell refs API what refs to change to what values? That dounds like a quite reasonable thing to do. Looking at the patch text, the only thing that stands out at me is that this does not seem to perform the updates in a single transaction, which may often not matter in practice, but may be a prudent thing to do anyway at philosophical level. Thanks, will queue.