From: D. Ben Knoble Date: Wed, 13 Aug 2025 18:55:30 GMT Subject: symmetric difference with --left-only vs. range notation Message-ID: In-Reply-To: <10372e00-3bb1-453a-bb62-332aaa935b24@gmail.com> On Sun, Aug 10, 2025 at 11:42 AM Phillip Wood wrote: > > Hi Julia > > On 09/08/2025 02:14, Julia Evans via GitGitGadget wrote: > > From: Julia Evans > > > > +Here is a more detailed description of what `git rebase ` does: > > + > > +First, it makes a list of all commits in the current branch that are not in > > +``. This is the same set of commits that would be shown by `git log > > +..HEAD`. > > The existing text is not quite accurate here, it should really say `git > log --cherry-pick --right-only ...HEAD` as we drop any commits > from the branch that have already been cherry-picked to . This reminds me, I've been meaning to ask: is there a meaningful difference between the following 2 commands? git rev-list --count --left-only @{u}... git rev-list --count ..@{u} In my estimation, since we're not using --cherry-pick here, the first says "list (count) the commits on upstream but not in HEAD, since the merge-base (which is reachable from both)" while the second says "list (count) the commits on upstream but not in HEAD." Is there ever a situation where those sets aren't the same? Of course the symmetric difference is not always the same as the range notation, but when we add --left-only [or --right-only, by symmetry ;)], does this collapse to the 2-dot notation? I've been assuming the latter is more performant, too, but if that's not the case, that's also good to know.