Uwe Kleine-König [off-list ref] writes:
If I do
git cat-file commit $commitid
for a commit created by stash, the next prompt starts directly after the
shortlog of HEAD.
Thanks.
I noticed another thing. The entries shown in "git stash list"
look like this:
stash@{0}: js/stash: e1d32c1... Teach git-stash to "apply --index"
stash@{1}: master: 5be6007... Rewrite "git-frotz" to "git frotz"
stash@{2}: master: 36e5e70... Start deprecating "git-command" in favor of "git command"
stash@{3}: master: 3b0d999... Merge branch 'jo/init'
But each of the stash is _not_ about these commits, but is about
some change that happens to be on top of them.
So risking to make it a tad longer, how about doing this on top?
---
git-stash.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/git-stash.sh b/git-stash.sh
index 9deda44..dd721d2 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -71,7 +71,7 @@ save_stash () {
git commit-tree $w_tree -p $b_commit -p $i_commit) ||
die "Cannot record working tree state"
- git update-ref -m "$msg" $ref_stash $w_commit ||
+ git update-ref -m "WIP on $msg" $ref_stash $w_commit ||
die "Cannot save the current status"
printf >&2 'Saved WIP on %s\n' "$msg"
}