git merge --abort? [was: Re: [PATCHv4 00/21] git notes merge]
- From
Johan Herland <johan@herland.net>
- Date
- Oct 22, 2010, 14:11 UTC
- Message-ID
- <201010221611.15425.johan@herland.net>
- In-Reply-To
- <7vaam7rv49.fsf@alter.siamese.dyndns.org>
On Friday 22 October 2010, Junio C Hamano wrote:
Show 9 quoted lines
> Sverre Rabbelier <srabbelier@gmail.com> writes: > > Can someone comment on whether "git reset --merge" is a good > > implementation of "git merge --abort"? If we can get an Ack from > > someone I'd love to see this implemented. > > I think it depends on in what state you started from and how the > merge operation stopped. If your index was clean, probably yes, but > "git reset --merge" may not be something you may want to do if the > merge stopped because you had previously added something.
Does this mean that there are situations where you simply _cannot_ get back to the pre-merge state (using 'git reset --merge' or otherwise)?
Is this something we should detect and warn about when starting the merge? Something like:
$ git merge bar I'm sorry, Dave. I'm afraid I can't merge with and unclean index. Use -f to force the merge anyway, but then 'git merge --abort' will lose your staged changes.
Or could we solve it simply by making a backup of the pre-merge index that can later be restored by 'git merge --abort'?
...Johan
-- Johan Herland, <johan@herland.net> www.herland.net