From: Phillip Wood Date: Mon, 17 Oct 2022 09:49:22 GMT Subject: Re: [PATCH v3 5/8] rebase: rename merge_base to branch_base Message-ID: <7b9d2a05-de2e-d0e0-6554-a592fa2349d4@dunelm.org.uk> In-Reply-To: <221013.86bkqfleh5.gmgdl@evledraar.gmail.com> On 13/10/2022 20:16, Ævar Arnfjörð Bjarmason wrote: > > On Thu, Oct 13 2022, Phillip Wood via GitGitGadget wrote: > >> From: Phillip Wood >> >> merge_base is not a very descriptive name, the variable always holds >> the merge-base of 'branch' and 'onto' which is commit at the base of >> the branch being rebased so rename it to branch_base. > > To me "branch" means or has heavier implications of "named branch" than > just a merge base, and this command is perfectly happy to work on > commits disconnected from any named branch. > > But more to the point, the rebase docs for --onto discuss a "merge > base", so you'd read those, and then encounter this code talking about a > "branch base", and wonder what the difference was... Aren't the docs saying the merge base is the base of the commits (i.e. branch) being rebased? I don't think merge_base is a particularly helpful name as it doesn't tell us what it is the merge base of and branch_base was the best I could come up with. I see what you mean in the detached HEAD case, but as the command also works with named branches I hope it is fairly obvious what "branch_base" is in the detached HEAD case. Best Wishes Phillip