'format-patch' is failing due to out of memory, and the error not being caught.
So 'rebase' thinks 'am' has completed successfully and continue on with
cleanup. i.e. move_to_original_branch
So the user loses commits from the original head, and have to rely on reflog to
return to the original head.

Since the exit status of 'format-patch' is not available, we have to use ||
with 'format-patch' to handle the error.  Also, when 'format-patch' fails, the
state_dir does not necessarily exist, so I'm putting the 'format-patch-failed'
file inside GIT_DIR. Is there a better location to put such a file?

The way I handle the error feels a bit bruteforced.  Any suggestions on a
better way to handle the error?

I also thought about separating 'format-patch' and 'am' into two separate
commands, and use an intermediate file to store the output of 'format-patch'.
But the intermediate file could get very big, so it didn't seem like a good

Andrew Wong (1):
  rebase: Handle cases where format-patch fails

 git-rebase--am.sh | 37 +++++++++++++++++++++++++++++++++++--
 1 file changed, 35 insertions(+), 2 deletions(-)


To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to