From: Avery Pennarun <apenwarr@gmail.com>
To: Jeff King <peff@peff.net>
Cc: Johannes Sixt <j.sixt@viscovery.net>,
Johannes Schindelin <Johannes.Schindelin@gmx.de>,
git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [RFC PATCH] am: do not do any reset on --abort
Date: Mon, 25 May 2009 12:10:21 -0400 [thread overview]
Message-ID: <32541b130905250910r251e4667m2b63b651e1724b59@mail.gmail.com> (raw)
In-Reply-To: <20090525160207.GB5449@coredump.intra.peff.net>
On Mon, May 25, 2009 at 12:02 PM, Jeff King <peff@peff.net> wrote:
> On Mon, May 25, 2009 at 02:17:48PM +0200, Johannes Sixt wrote:
>
>> I wonder why we have this problem (and do something about it) with git-am,
>> but not with git-rebase. Is it perhaps that the usual case were people
>> were bitten by the old behavior is:
>
> I don't know. I had assumed a safety valve we put in git-am might need
> to be matched in rebase. But I don't recall whether I have screwed
> myself in the same way with rebase. Perhaps because rebase happens on a
> detached HEAD, I tend to notice sooner that something is not right.
Ah, maybe that's the difference. rebase seems to detach the HEAD,
then do a bunch of stuff, then reset the original branch only when
it's done. So aborting doesn't reset any branches at all, it just
checks out the original branch.
Thus one option would be to try to make am more like rebase: detach
the HEAD before it starts, and reattach it only on success. At least
then you only have one set of UI problems to fix.
(Of course, I've gotten myself into trouble anyway by checking new
stuff in on the detached HEAD and later aborting a rebase. I have
quite a love-hate relationship with detached HEADs.)
Maybe the best solution here isn't to prevent people from shooting
themselves in the foot, but instead to help them recover afterwards.
I've noticed most people don't know about 'git reflog'; they often
seem astonished when I tell them about it. reflog + not blowing away
dirty repositories would mean that you're always safe.
Have fun,
Avery
next prev parent reply other threads:[~2009-05-25 16:11 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-06 19:19 Bug: 'git am --abort' can silently reset the wrong branch Eduardo Habkost
2009-05-08 8:28 ` Jeff King
2009-05-08 8:37 ` Sverre Rabbelier
2009-05-08 9:01 ` Junio C Hamano
2009-05-08 9:12 ` Jeff King
2009-05-25 10:43 ` [RFC PATCH] am: do not do any reset on --abort Jeff King
2009-05-25 11:49 ` Johannes Schindelin
2009-05-25 12:00 ` Jeff King
2009-05-25 12:17 ` Johannes Sixt
2009-05-25 15:54 ` Avery Pennarun
2009-05-25 16:00 ` Jeff King
2009-05-25 16:02 ` Jeff King
2009-05-25 16:10 ` Avery Pennarun [this message]
2009-05-25 22:23 ` Junio C Hamano
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=32541b130905250910r251e4667m2b63b651e1724b59@mail.gmail.com \
--to=apenwarr@gmail.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=j.sixt@viscovery.net \
--cc=peff@peff.net \
/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).