All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: Tim Mazid <timmazid@hotmail.com>
Cc: gitster@pobox.com, martin.von.zweigbergk@gmail.com,
	Git Mailing List <git@vger.kernel.org>,
	artagnon@gmail.com
Subject: Re: [PATCH] rebase: learn --discard subcommand
Date: Sat, 28 May 2011 17:50:46 -0500	[thread overview]
Message-ID: <20110528225046.GA31449@elie> (raw)
In-Reply-To: <SNT124-W247D44D043F692CA06747EC4790@phx.gbl>

Hi,

Tim Mazid wrote:

> I'd just like to say that I sometime use "git reset --hard" in the middle
> of a "git rebase" when I want to get rid of some changes completely.
> Now, I'm not saying that this is the best way of doing it ("git checkout --"
> is probably far superior?)

 . "git checkout -- ." to discard unadded changes
 . "git checkout HEAD -- ." to discard uncommitted changes
 . "git reset --keep HEAD^" to work against a different commit
 . "git reset --merge" to discard a merge resolution in progress

While I also would be happy to see "git reset --hard" to abort
am/rebase, I see two problems, one with an obvious solution, the other
not:

1. It would be a big change in behavior that directly goes against
muscle memory, as you mentioned.  This part could be mitigated by
providing "undo" functionality (e.g., renaming the .git/rebase-merge
directory instead of deleting it) and printing advice including a
command that gets the sequencer state back.

2. It does not help people like me who are fearful about scribbling
over accidentally unstaged or uncommitted changes.  This could be
mitigated by also providing forget-sequence functionality through
separate commands like "git rebase --discard".

  reply	other threads:[~2011-05-28 22:51 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-28  2:58 [PATCH] rebase: learn --discard subcommand Martin von Zweigbergk
2011-05-28 13:15 ` Ramkumar Ramachandra
2011-05-29 12:50   ` Martin von Zweigbergk
2011-05-28 18:51 ` Junio C Hamano
2011-05-28 20:26   ` Tim Mazid
2011-05-28 22:50     ` Jonathan Nieder [this message]
2011-05-29 13:14   ` Martin von Zweigbergk
2011-05-29 13:41     ` Jakub Narebski
2011-05-30  4:50   ` Michael Haggerty
2011-05-28 23:08 ` Jonathan Nieder
2011-05-29  9:30   ` Tim Mazid
2011-05-29 17:28   ` Martin von Zweigbergk
2011-05-29 18:58     ` Jonathan Nieder
2011-05-30  4:46   ` Michael Haggerty
2011-05-30  5:14     ` Tim Mazid
2011-05-30  8:44       ` Michael Haggerty
2011-05-30  5:01   ` Miles Bader

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=20110528225046.GA31449@elie \
    --to=jrnieder@gmail.com \
    --cc=artagnon@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=martin.von.zweigbergk@gmail.com \
    --cc=timmazid@hotmail.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.