Alban Gruin <alban.gruin@xxxxxxxxx> writes: > Forget this patch, I forgot to clearly say that the `am' backend is not > affected. The phrase "is not affected" makes it sound like "Do not worry, I made sure it is not broken by this patch", but I do not think that is the more important part ;-). The shared codepath for all types of rebase before dispatching already knew what commit at the tip of the branch being rebased is, but the sequencer-based backend was doing unnecessary work to figure it out again by checking it out. And this patch is about fixing that, isn't it? So I do not think singling out 'am' is a good use of readers' time. The first paragraph can be further tweaked why the extra checkout is unneeded. Before dispatching the control to one of the individual rebase backends, the shared codepath in "rebase" figures out what branch is being rebased, because it is necessary to compute the range of commits to replay to run any backend. The rebase backend based on the sequencer machinery (used for '-i', '-r' and '-m') however computed this commit range by actually checking out the branch and reading HEAD, which was unnecessary, as the working tree is then immediately gets reset to that of the commit on which rebased history is built (aka "onto" commit). or something along the line, perhaps? With this patch applied, the wasteful prepare_branch_to_be_rebased() has no caller, and the patch removes it from sequencer.[ch] as well, which is very good.