Re: [PATCH] rebase: learn --discard subcommand

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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".
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]