From: Jeff King <peff@peff.net>
To: Johannes Sixt <j6t@kdbg.org>
Cc: Junio C Hamano <gitster@pobox.com>,
Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH 2/2] checkout (detached): truncate list of orphaned commits at the new HEAD
Date: Sat, 5 May 2012 05:01:09 -0400 [thread overview]
Message-ID: <20120505090108.GA8172@sigill.intra.peff.net> (raw)
In-Reply-To: <4FA41C98.2010105@kdbg.org>
On Fri, May 04, 2012 at 08:14:48PM +0200, Johannes Sixt wrote:
> When git checkout switches from a detached HEAD to any other commit, then
> all orphaned commits were listed in a warning:
>
> Warning: you are leaving 2 commits behind...:
>
> a5e5396 another fixup
> 6aa1af6 fixup foo
>
> But if the new commit is actually one from this list (6aa1af6 in this
> example), then the list in the warning can be truncated at the new HEAD,
> because history beginning at HEAD is not "left behind". This makes it so.
Thanks, this has bugged me a few times in the past, but I've never
gotten around to investigating and fixing it.
> builtin/checkout.c | 13 +++++++------
> t/t2020-checkout-detach.sh | 2 +-
> 2 files changed, 8 insertions(+), 7 deletions(-)
The patch looks right to me.
-Peff
prev parent reply other threads:[~2012-05-05 9:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-04 18:13 [PATCH 1/2] t2020-checkout-detach: check for the number of orphaned commits Johannes Sixt
2012-05-04 18:14 ` [PATCH 2/2] checkout (detached): truncate list of orphaned commits at the new HEAD Johannes Sixt
2012-05-04 19:51 ` Junio C Hamano
2012-05-05 9:01 ` Jeff King [this message]
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=20120505090108.GA8172@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=j6t@kdbg.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).