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

[PATCH 6/6] rebase: use 'git stash store' to simplify logic

From
Ramkumar Ramachandra <artagnon@gmail.com>
Date
May 13, 2013, 12:45 UTC
Message-ID
<1368449154-21882-7-git-send-email-artagnon@gmail.com>
In-Reply-To
<1368449154-21882-1-git-send-email-artagnon@gmail.com>

rebase has no reason to know about the implementation of the stash. In the case when applying the autostash results in conflicts, replace the relevant code in finish_rebase () to simply call 'git stash store'.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
---
 git-rebase.sh | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/git-rebase.sh b/git-rebase.sh
index f4a3a26..7c82f95 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -153,11 +153,7 @@ finish_rebase () {
 		then
 			gettext "Applied autostash."
 		else
-			ref_stash=refs/stash &&
-			: >>"$GIT_DIR/logs/$ref_stash" &&
-			git update-ref -m "autostash" $ref_stash $stash_sha1 ||
-			die "$(eval_gettext 'Cannot store $stash_sha1')"
-
+			git stash store $stash_sha1 "autostash" &&
 			gettext 'Applying autostash resulted in conflicts.
 Your changes are safe in the stash.
 You can run "git stash pop" or "git stash drop" at any time.
-- 
1.8.3.rc1.57.g4ac1522
Previous: Junio C Hamano
Message 21 of 21 in “Get stash to help rebase.autostash”
  1. 0/6 Get stash to help rebase.autostashRamkumar Ramachandra, May 13, 2013
  2. 1/6 Documentation/stash: correct synopsis for createRamkumar Ramachandra, May 13, 2013
  3. 2/6 Documentation/stash: document short form -p in synopsisRamkumar Ramachandra, May 13, 2013
  4. 3/6 stash: simplify option parser for createRamkumar Ramachandra, May 13, 2013
  5. Junio C HamanoMay 13, 2013
  6. Ramkumar RamachandraMay 13, 2013
  7. 4/6 stash: introduce 'git stash store'Ramkumar Ramachandra, May 13, 2013
  8. Junio C HamanoMay 13, 2013
  9. Ramkumar RamachandraMay 13, 2013
  10. Junio C HamanoMay 13, 2013
  11. Ramkumar RamachandraMay 13, 2013
  12. Junio C HamanoMay 13, 2013
  13. Ramkumar RamachandraMay 13, 2013
  14. Junio C HamanoMay 13, 2013
  15. Ramkumar RamachandraMay 13, 2013
  16. Junio C HamanoMay 13, 2013
  17. Ramkumar RamachandraMay 13, 2013
  18. Ramkumar RamachandraMay 13, 2013
  19. 5/6 stash: tweak error message in store_stash ()Ramkumar Ramachandra, May 13, 2013
  20. Junio C HamanoMay 13, 2013
  21. 6/6 rebase: use 'git stash store' to simplify logicRamkumar Ramachandra, May 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.