git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Rebase doesn't restore branch pointer back on out of memory

From
Andrew Wong <andrew.kw.w@gmail.com>
Date
Oct 5, 2012, 04:53 UTC
Message-ID
<1349412790-6087-1-git-send-email-andrew.kw.w@gmail.com>
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
Previous: Alexander KostikovNext: Andrew Wong
Message 8 of 17 in “Rebase doesn't restore branch pointer back on out of memory”
  1. Alexander KostikovOct 3, 2012
  2. Andrew WongOct 3, 2012
  3. Andrew WongOct 4, 2012
  4. Alexander KostikovOct 4, 2012
  5. Alexander KostikovOct 4, 2012
  6. Andrew WongOct 4, 2012
  7. Alexander KostikovOct 4, 2012
  8. Andrew WongOct 5, 2012
  9. [RFC] rebase: Handle cases where format-patch failsAndrew Wong, Oct 5, 2012
  10. Junio C HamanoOct 5, 2012
  11. Andrew WongOct 8, 2012
  12. [RFC] rebase: Handle cases where format-patch failsAndrew Wong, Oct 8, 2012
  13. Junio C HamanoOct 8, 2012
  14. Andrew WongOct 11, 2012
  15. rebase: Handle cases where format-patch failsAndrew Wong, Oct 11, 2012
  16. Alexander KostikovOct 19, 2012
  17. Junio C HamanoOct 19, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.