Re: [PATCH] git-gui: give more advice when detaching HEAD

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH] git-gui: give more advice when detaching HEAD

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:50:33

Jeff King [off-list ref] writes:
Is it that cheap? A full reachability check for something that is not in
any ref would involve going to the roots, wouldn't it?
You only need to dig until you hit a merge base, no?

In this case, you would need to compute just one merge base, between the
commit you are about to leave, and the (imaginary) commit that is a merge
across all the tips of your refs.  If the merge base is the commit you are
about to leave, you were sightseeing in the past without creating anything
new, otherwise you will lose commits between the computed base and the
commit you are about to leave.

And merge-base has an interface to compute exactly that, I think.

Re: [PATCH] git-gui: give more advice when detaching HEAD

From: Jeff King <hidden>
Date: 2016-06-15 22:50:33

On Sat, Feb 12, 2011 at 12:17:16AM -0800, Junio C Hamano wrote:
Jeff King [off-list ref] writes:
quoted
Is it that cheap? A full reachability check for something that is not in
any ref would involve going to the roots, wouldn't it?
You only need to dig until you hit a merge base, no?
Hmm, yeah, you're right. In the worst case of reachability checks, you
would share no ancestry and go to the roots searching for the merge
base, but of course that is very unlikely to be the case here. So it
should be much cheaper.
And merge-base has an interface to compute exactly that, I think.
Want to do a proof-of-concept patch? Then we can get some real timings.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help