From: Junio C Hamano Date: Thu, 16 Jul 2009 20:41:46 GMT Subject: Re: [PATCHv2 2/2] pull: support rebased upstream + fetch + pull --rebase Message-ID: <7vhbxc8inp.fsf@alter.siamese.dyndns.org> In-Reply-To: Johannes Schindelin writes: > How about > > oldremoteref="$(git rev-list --boundary HEAD --not \ > $(git rev-list -g $remoteref | sed 's/$/^@/') | > sed -e '/^[^-]/d' -e q)" > > Explanation: the "git rev-list -g $remoteref" lists the previous commits > the remote ref pointed to, and the ^@ appended to them means all their > parents. Now, the outer rev-list says to take everything in HEAD but > _not_ in those parents, showing the boundary commits. The "sed" call > lists the first such boundary commit (which must, by construction, be one > of the commits shown by the first rev-list). Hmm, I am not sure about that "(which must..." part. When you have Y---X / B---o---o---o---H wouldn't "rev-list --boundary H --not X^@" give B, not X nor Y?