Re: Proper way to abort incorrect cherry-picking?

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jonathan Nieder
Date: Wednesday, April 28, 2010 - 4:37 pm

Hi Jon,

Jon Seymour wrote:


The HEAD doesn’t advance in a failed merge, right?

[...]

If this were really necessary, I would consider it a bug.

I do think recovery is more complicated than it needs to be, since one
has to check whether the merge/cherry-pick failed before cancelling
it.  There are three cases.

 - If an early check prevented the operation (message with “fatal:”,
   status = 128), then the index and work tree were not touched.

   No recovery required.

 - If there were conflicts (message with “Conflicts:”, status = 1),
   the index will record the competing versions of conflicted files,
   and the work tree will represent the situation with conflict
   markers.

   Use ‘git reset --merge’ to recover.

 - If the merge proceeded cleanly (status = 0), but it was a bad
   idea after all, the index and work tree record the new version now.

   Use ‘git reset --keep HEAD@{1}’ to undo the operation.

Have fun,
Jonathan
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Proper way to abort incorrect cherry-picking?, Eugene Sajine, (Wed Apr 28, 12:38 pm)
Re: Proper way to abort incorrect cherry-picking?, David Borowitz, (Wed Apr 28, 12:49 pm)
Re: Proper way to abort incorrect cherry-picking?, Jonathan Nieder, (Wed Apr 28, 12:50 pm)
Re: Proper way to abort incorrect cherry-picking?, Eugene Sajine, (Wed Apr 28, 12:59 pm)
Re: Proper way to abort incorrect cherry-picking?, Eugene Sajine, (Wed Apr 28, 1:05 pm)
Re: Proper way to abort incorrect cherry-picking?, Jon Seymour, (Wed Apr 28, 3:39 pm)
Re: Proper way to abort incorrect cherry-picking?, Jonathan Nieder, (Wed Apr 28, 4:37 pm)
Re: Proper way to abort incorrect cherry-picking?, Jon Seymour, (Wed Apr 28, 5:07 pm)
git cherry(pick) dumps core, Andreas Krey, (Thu Apr 29, 12:11 pm)
Re: git cherry(pick) dumps core, Jonathan Nieder, (Thu Apr 29, 12:49 pm)
Re: git cherry(pick) dumps core, Andreas Krey, (Thu Apr 29, 1:21 pm)
Re: git cherry(pick) dumps core, Jonathan Nieder, (Fri Apr 30, 6:32 am)
[PATCH] cherry-pick: do not dump core when iconv fails, Jonathan Nieder, (Sat May 8, 4:17 pm)