Alban Gruin <alban.gruin@xxxxxxxxx> writes: >>>> I do not think "base_commit" is a good name, either, though. When I >>>> hear 'base' in the context of 'rebase', I would imagine that the >>>> speaker is talking about the bottom of the range of the commits to >>>> be rebased (i.e. "rebase --onto ONTO BASE BRANCH", which replays >>>> commits BASE..BRANCH on top of ONTO and then points BRANCH at the >>>> result), not the top of the range or the branch these commits are >>>> taken from. >>> ... > Now I really don’t know how to call this function. > checkout_top_of_range(), perhaps? If this is a straight rewrite of setup_reflog_action, i.e. the division of labor between its caller and this function is such that the caller blindly calls it without even checking if it got the optional "branch to be rebased" argument and this function is responsible to decide if the preparatory checkout of the named branch is necessary, then any name that does not even hint that checkout is done conditionally would not work well. How about callilng it "prepare_branch_to_be_rebased()"? This function, at least the original setup_reflog_action, responds to git rebase [--onto ONTO] UPSTREAM by doing nothing (i.e. the result of preparation is to do nothing because we are rebasing the commits between UPSTREAM and currently checked out state on top of ONTO, or UPSTREAM if ONTO is not given) and it responds to git rebase [--onto ONTO] UPSTREAM BRANCH by checking out BRANCH (most importantly, when given a concrete branch name, it checks the branch out, and does not detach at the commit at the tip of the branch), because that is the first preparatory step to rebase the BRANCH.