git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Andrew Wong <andrew.kw.w@gmail.com>
To: git@vger.kernel.org
Cc: alex.kostikov@gmail.com, Andrew Wong <andrew.kw.w@gmail.com>
Subject: Re: Rebase doesn't restore branch pointer back on out of memory
Date: Fri,  5 Oct 2012 00:53:09 -0400	[thread overview]
Message-ID: <1349412790-6087-1-git-send-email-andrew.kw.w@gmail.com> (raw)
In-Reply-To: <506E1327.1070602@gmail.com>

'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
idea.

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

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

-- 
1.8.0.rc0.18.gf84667d

  parent reply	other threads:[~2012-10-05  6:42 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-03 19:47 Rebase doesn't restore branch pointer back on out of memory Alexander Kostikov
2012-10-03 21:52 ` Andrew Wong
     [not found]   ` <CAGAhT3mVn-W5P-n_YeafZ_7bntkJGArJ3o6+dA5GO_H44=KHFg@mail.gmail.com>
2012-10-04 15:13     ` Andrew Wong
2012-10-04 21:09       ` Alexander Kostikov
2012-10-04 21:39         ` Alexander Kostikov
2012-10-04 22:52         ` Andrew Wong
2012-10-04 23:59           ` Alexander Kostikov
2012-10-05  4:53           ` Andrew Wong [this message]
2012-10-05  4:53             ` [RFC] rebase: Handle cases where format-patch fails Andrew Wong
2012-10-05 20:17               ` Junio C Hamano
2012-10-08 19:36                 ` Andrew Wong
2012-10-08 19:36                   ` Andrew Wong
2012-10-08 22:38                     ` Junio C Hamano
2012-10-11  3:54                       ` Rebase doesn't restore branch pointer back on out of memory Andrew Wong
2012-10-11  3:54                         ` [PATCH] rebase: Handle cases where format-patch fails Andrew Wong
2012-10-19 21:49                         ` Rebase doesn't restore branch pointer back on out of memory Alexander Kostikov
2012-10-19 22:24                           ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1349412790-6087-1-git-send-email-andrew.kw.w@gmail.com \
    --to=andrew.kw.w@gmail.com \
    --cc=alex.kostikov@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).