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

[PATCH 2/7] rebase -i: don't error out if $state_dir already exists

From
Ramkumar Ramachandra <artagnon@gmail.com>
Date
May 12, 2013, 11:56 UTC
Message-ID
<1368359801-28121-3-git-send-email-artagnon@gmail.com>
In-Reply-To
<1368359801-28121-1-git-send-email-artagnon@gmail.com>

In preparation for a later patch that will create $state_dir/autostash in git-rebase.sh before anything else can happen, change a `mkdir $state_dir` call to `mkdir -p $state_dir`. The change is safe, because this is not a test to detect an in-progress rebase (that is already done much earlier in git-rebase.sh).

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
---
 git-rebase--interactive.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 5822b2c..3411139 100644
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -842,7 +842,7 @@ then
 fi
 
 orig_head=$(git rev-parse --verify HEAD) || die "No HEAD?"
-mkdir "$state_dir" || die "Could not create temporary $state_dir"
+mkdir -p "$state_dir" || die "Could not create temporary $state_dir"
 
 : > "$state_dir"/interactive || die "Could not mark as interactive"
 write_basic_state
-- 
1.8.3.rc1.51.gd7a04de
Previous: Ramkumar RamachandraNext: Ramkumar Ramachandra
Message 3 of 22 in “rebase.autostash completed”
  1. 0/7 rebase.autostash completedRamkumar Ramachandra, May 12, 2013
  2. 1/7 am: tighten a conditional that checks for $dotestRamkumar Ramachandra, May 12, 2013
  3. 2/7 rebase -i: don't error out if $state_dir already existsRamkumar Ramachandra, May 12, 2013
  4. 3/7 rebase: prepare to do generic housekeepingRamkumar Ramachandra, May 12, 2013
  5. 4/7 am: return control to caller, for housekeepingRamkumar Ramachandra, May 12, 2013
  6. 5/7 rebase -i: return control to caller, for housekeepingRamkumar Ramachandra, May 12, 2013
  7. 6/7 rebase --merge: return control to caller, for housekeepingRamkumar Ramachandra, May 12, 2013
  8. 7/7 rebase: implement --[no-]autostash and rebase.autostashRamkumar Ramachandra, May 12, 2013
  9. Junio C HamanoMay 13, 2013
  10. Ramkumar RamachandraMay 13, 2013
  11. Junio C HamanoMay 13, 2013
  12. Ramkumar RamachandraMay 13, 2013
  13. Matthieu MoyMay 13, 2013
  14. Ramkumar RamachandraMay 13, 2013
  15. Matthieu MoyMay 13, 2013
  16. Junio C HamanoMay 13, 2013
  17. Ramkumar RamachandraMay 13, 2013
  18. Matthieu MoyMay 13, 2013
  19. Junio C HamanoMay 13, 2013
  20. Junio C HamanoMay 13, 2013
  21. Ramkumar RamachandraMay 13, 2013
  22. Junio C HamanoMay 13, 2013

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.