On 13/10/2022 20:16, Ævar Arnfjörð Bjarmason wrote:
On Thu, Oct 13 2022, Phillip Wood via GitGitGadget wrote:
From: Phillip Wood <phillip.wood@xxxxxxxxxxxxx>
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