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

[PATCH 0/2] git-stash last-minute fixes

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 28, 2007, 06:59 UTC
Message-ID
<7vbqdxui72.fsf@assigned-by-dhcp.cox.net>
Here are a small patch series to git-stash.
 [1/2] Fix git-stash apply --index
 This fixes two rather embarrasing bugs in "apply --index".
 [2/2] git-stash apply --index: optimize postprocessing
 This builds on top of the previous one to avoid unnecessary
 index manipulations that is later wiped by a read-tree.

There also is a bugfix I received privately from Nana for the breakage I introduced with 7ab3cc70. I've already queued it for 'master'.

-- >8 --
From: しらいしななこ <nanako3@bluebottle.com>
Date: Sat, 28 Jul 2007 10:44:48 +0900
Subject: [PATCH] git-stash: Make sure reflog is created for refs/stash

Earlier commit 7ab3cc70 fixed "stash clear" but broke save_stash, because it forgot to make sure the reflog file exists before saving.

Signed-off-by: Nanako Shiraishi <nanako3@bluebottle.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff --git a/git-stash.sh b/git-stash.sh
index f90dffd..0073e9d 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -36,6 +36,9 @@ save_stash () {
 	test -f "$GIT_DIR/logs/$ref_stash" ||
 		clear_stash || die "Cannot initialize stash"
 
+	# Make sure the reflog for stash is kept.
+	: >>"$GIT_DIR/logs/$ref_stash"
+
 	# state of the base commit
 	if b_commit=$(git rev-parse --verify HEAD)
 	then
Next: Junio C Hamano
Message 1 of 4 in “git-stash last-minute fixes”
  1. 0/2 git-stash last-minute fixesJunio C Hamano, Jul 28, 2007
  2. 1/2 Fix git-stash apply --indexJunio C Hamano, Jul 28, 2007
  3. 2/2 git-stash apply --index: optimize postprocessingJunio C Hamano, Jul 28, 2007
  4. しらいしななこJul 28, 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.