From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: "Shawn O. Pearce" <spearce@spearce.org>, git@vger.kernel.org
Subject: Re: [PATCH] git-gui: give more advice when detaching HEAD
Date: Sat, 12 Feb 2011 03:04:57 -0500 [thread overview]
Message-ID: <20110212080456.GA18380@sigill.intra.peff.net> (raw)
In-Reply-To: <7v8vxlzojs.fsf@alter.siamese.dyndns.org>
On Fri, Feb 11, 2011 at 11:42:47PM -0800, Junio C Hamano wrote:
> Jeff King <peff@peff.net> writes:
>
> > 2. When leaving the detached state, notice that we have commits not
> > contained in any other ref and pop up an "are you sure you want to
> > lose these commits" dialog, with an option to create a branch. This
> > is something we considered and rejected for the CLI, but I wonder
> > if it makes more sense for git-gui.
>
> Hmm, I don't recall the discussion on this for the CLI, but it intuitively
> feels like a good thing to do, unless it incurs an unacceptable cost.
I think one of the main concerns was cost, but I'm having trouble coming
up with the exact thread that I recall.
There is some discussion here, including Linus endorsing an exact-ref
check:
http://article.gmane.org/gmane.comp.version-control.git/36428
There is a lot of back and forth, but I didn't have the patience to read
it all.
There is also this thread:
http://thread.gmane.org/gmane.comp.version-control.git/94695
where one of the arguments against a leaving-detached safety valve seems
to be "well, we reflog the HEAD these days, so it's no big deal" (and
indeed, in this confused user case, the reflog did end up being the
recovery method).
I have a feeling there is another thread somewhere, but I can't find it.
> Temporarily detaching HEAD by scripts like rebase and am that know what
> they are doing should never have to pay the penalty, but an expert user
> who worked interactively on the detached HEAD can be made to wait for 0.2
> second more.
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? On linux-2.6,
that is something like 3s on my fast-ish machine. Though I guess using
commit-time cutoffs could make it really short (which reminds me, I
really need to clean up and post my patches to deal with clock skew).
> Your 1 and 3 both sound like sensible things to do, but I am not a good
> judge on them as I rarely if ever work in GUI.
That's kind of how I feel. I've never actually used git-gui beyond
trying to help users.
-Peff
next prev parent reply other threads:[~2011-02-12 8:04 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-12 7:05 [PATCH] git-gui: give more advice when detaching HEAD Jeff King
2011-02-12 7:42 ` Junio C Hamano
2011-02-12 8:04 ` Jeff King [this message]
2011-02-12 8:17 ` Junio C Hamano
2011-02-12 8:21 ` Jeff King
2011-02-17 23:13 ` Junio C Hamano
2011-02-12 8:42 ` Junio C Hamano
2011-02-13 0:05 ` Sverre Rabbelier
2011-02-13 9:22 ` Johannes Sixt
2011-02-13 23:10 ` Junio C Hamano
2011-02-13 12:31 ` Heiko Voigt
2011-02-15 6:39 ` Jeff King
2011-02-15 19:16 ` Heiko Voigt
2011-02-15 19:48 ` Pat Thoyts
2011-02-16 3:50 ` Jeff King
2011-02-17 17:38 ` Heiko Voigt
2011-02-16 3:46 ` Jeff King
2011-02-17 17:27 ` Heiko Voigt
[not found] ` <5828845.77740.1297797387140.JavaMail.trustmail@mail1.terreactive.ch>
2011-02-16 16:11 ` Victor Engmark
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110212080456.GA18380@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=spearce@spearce.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).