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

[PATCH] git-stash: Fix listing stashes

From
EMEmil Medve <emilian.medve@freescale.com>
Date
Nov 7, 2007, 21:10 UTC
Message-ID
<1194469827-17037-1-git-send-email-Emilian.Medve@Freescale.com>

Commit bc9e7399af3790918140c30a5b2c85bf9a8f1ad3 "reverted" commit f12e925ac23ad6169e046cfe05b8438a1611ad58

Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com>
---
 git-stash.sh |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/git-stash.sh b/git-stash.sh
index e556f42..534eb16 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -22,7 +22,7 @@ no_changes () {
 clear_stash () {
 	if current=$(git rev-parse --verify $ref_stash 2>/dev/null)
 	then
-		git update-ref -d refs/stash $current
+		git update-ref -d $ref_stash $current
 	fi
 }
 
@@ -93,6 +93,10 @@ save_stash () {
 		clear_stash || die "Cannot initialize stash"
 
 	create_stash "$stash_msg"
+
+	# Make sure the reflog for stash is kept.
+	: >>"$GIT_DIR/logs/$ref_stash"
+
 	git update-ref -m "$stash_msg" $ref_stash $w_commit ||
 		die "Cannot save the current status"
 	printf >&2 'Saved "%s"\n' "$stash_msg"
-- 
1.5.3.GIT
Next: Junio C Hamano
Message 1 of 2 in “git-stash: Fix listing stashes”
  1. git-stash: Fix listing stashesEmil Medve, Nov 7, 2007
  2. Junio C HamanoNov 7, 2007

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.