git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Miseler <alexander@miseler.de>
To: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: [RFD] make rebase abort to original branch, not rebased branch
Date: Sun, 13 Mar 2011 16:27:43 +0100	[thread overview]
Message-ID: <4D7CE26F.9070608@miseler.de> (raw)
In-Reply-To: <alpine.DEB.2.00.1103131013370.15442@debian>

>>> In most cases, this is just a small annoyance, since it's usually
>>> quick and easy to manually switch back to the original
>>> branch. However, I have run into at least two cases where it has been
>>> a bit more annoying:
>>>
>>>  1. When on a detached HEAD and running "git rebase HEAD topic", if
>>>     you abort the rebase, you will have to look up the old commit in
>>>     the reflog.
>>
>> Doesn't this merely show a bad discipline? What were you envisioning to
>> do to your detached HEAD state if the rebase were to succeed? IOW, if the
>> state was so precious, why did you decide to switch to topic and rebase it
>> onto that state, without marking?
> 
> This usually happens when I see something that looks a bit suspicious
> in one of my own commits on my topic branch. I then check out that
> commit to have a look and perhaps run some test. If I find something
> broken, I would fix it and either amend the commit or create a new
> commit on top. I would then run "git rebase --onto HEAD HEAD~1 topic"
> or "git rebase HEAD topic", respectively. If the merge conflicts turn
> out to be bigger than I expected, I may decide to abort and to instead
> create a new branch for the commit(s) until I find time/energy.

This can be easily fixed for your own repository by installing a pre-rebase hook that force-sets a temporary branch (named e.g. "pre-rebase") to the current commit before starting the rebase. I can highly recommend having such a hook, it's damn useful.

      reply	other threads:[~2011-03-13 15:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-13  3:58 [RFD] make rebase abort to original branch, not rebased branch Martin von Zweigbergk
2011-03-13  7:05 ` Junio C Hamano
2011-03-13  7:46   ` Junio C Hamano
2011-03-13 14:58   ` Martin von Zweigbergk
2011-03-13 15:27     ` Alexander Miseler [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=4D7CE26F.9070608@miseler.de \
    --to=alexander@miseler.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=martin.von.zweigbergk@gmail.com \
    /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).