Subject: git merge --abort? [was: Re: [PATCHv4 00/21] git notes merge]

From: Johan Herland <[email-masked]>
Date: Fri, 22 Oct 2010 16:11:15 +0200

On Friday 22 October 2010, Junio C Hamano wrote:
> Sverre Rabbelier <[email-masked]> 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, <[email-masked]>
www.herland.net