Re: [PATCH] rebase: use reflog to find common base with upstream
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 24, 2013, 19:04 UTC
- Message-ID
- <xmqqhac6o5hj.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <CANiSa6gqGKAyLwwPVoZ_gzN85_06aTCfkdRRscNNZYs7g1rL0A@mail.gmail.com>
Martin von Zweigbergk <martinvonz@gmail.com> writes:
Show 7 quoted lines
> 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.