All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] rebase: add --forget to cleanup rebase, leave HEAD untouched
Date: Wed, 26 Oct 2016 09:51:02 -0700	[thread overview]
Message-ID: <xmqq60ofcavd.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20161026094658.20704-1-pclouds@gmail.com> ("Nguyễn Thái Ngọc Duy"'s message of "Wed, 26 Oct 2016 16:46:58 +0700")

Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:

> There are occasions when you decide to abort an in-progress rebase and
> move on to do something else but you forget to do "git rebase --abort"
> first. Or the rebase has been in progress for so long you forgot about
> it. By the time you realize that (e.g. by starting another rebase)
> it's already too late to retrace your steps. The solution is normally
>
>     rm -r .git/<some rebase dir>
>
> and continue with your life. But there could be two different
> directories for <some rebase dir> (and it obviously requires some
> knowledge of how rebase works), and the ".git" part could be much
> longer if you are not at top-dir, or in a linked worktree. And
> "rm -r" is very dangerous to do in .git, a mistake in there could
> destroy object database or other important data.
>
> Provide "git rebase --forget" for this exact use case.

Two and a half comments.

 - The title says "leave HEAD untouched".  Are my working tree files
   and my index also safe from this operation, or is HEAD the only
   thing that is protected?

 - I think I saw a variant of this gotcha for an unconcluded
   cherry-pick that was left behind, which the bash-prompt script
   did not notice but the next "git cherry-pick" did by complaining
   "you are in the middle" or something like that.  Perhaps we would
   want to have a similarly sounding option to help that case, too,
   not in this patch but as another patch on the same theme?

 - Would it have helped if bash-prompt were in use?  I am not saying
   that this patch becomes unnecessary if you use it; I am trying to
   see if it helps its users by reminding them what state they are
   in.


  reply	other threads:[~2016-10-26 16:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-26  9:46 [PATCH] rebase: add --forget to cleanup rebase, leave HEAD untouched Nguyễn Thái Ngọc Duy
2016-10-26 16:51 ` Junio C Hamano [this message]
2016-10-27 10:40   ` Duy Nguyen
2016-10-31 19:25     ` Junio C Hamano
2016-11-09  9:11 ` [PATCH v2] rebase: add --forget to cleanup rebase, leave everything else untouched Nguyễn Thái Ngọc Duy
2016-11-09 20:12   ` Junio C Hamano
2016-11-10 11:09     ` Duy Nguyen
2016-11-10 11:22       ` Duy Nguyen
2016-11-10 19:07         ` Junio C Hamano
2016-11-12  2:00   ` [PATCH v3] " Nguyễn Thái Ngọc Duy

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=xmqq60ofcavd.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=pclouds@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.