From: Junio C Hamano Date: Thu, 24 Oct 2013 19:04:24 GMT Subject: Re: [PATCH] rebase: use reflog to find common base with upstream Message-ID: In-Reply-To: Martin von Zweigbergk writes: > I think > > git merge-base HEAD $(git rev-list -g "$upstream_name") > > is roughly correct and hopefully fast enough. That can lead to too > long a command line, so I was planning on teaching merge-base a > --stdin option, but never got around to it. Sorry for coming in late. I think the above with s/HEAD/$curr_branch/ is a good way to compute what the whole "for reflog in $(git rev-list -g $remoteref" loop computes when one of the historic tips recorded in the reflog was where $curr_branch forked from, i.e. the loop actually finds at least one ancestor in the reflog and breaks out after setting oldremoteref. But it would give a completely different commit if none of the reflog entries is a fork point. A two patch series forthcoming.