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

[PATCH v3 4/5] stash list: use new %g formats instead of sed

From
Thomas Rast <trast@student.ethz.ch>
Date
Oct 16, 2009, 14:20 UTC
Message-ID
<1d2a75bdb94691839f4a8ce0d1712d2bac6e405d.1255701207.git.trast@student.ethz.ch>
In-Reply-To
<cover.1255701207.git.trast@student.ethz.ch>

With the new formats, we can rewrite 'git stash list' in terms of an appropriate pretty format, instead of hand-editing with sed. This has the advantage that it obeys the normal settings for git-log, notably the pager.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
---
 git-stash.sh |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/git-stash.sh b/git-stash.sh
index 4febbbf..f8847c1 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -205,8 +205,7 @@ have_stash () {
 
 list_stash () {
 	have_stash || return 0
-	git log --no-color --pretty=oneline -g "$@" $ref_stash -- |
-	sed -n -e 's/^[.0-9a-f]* refs\///p'
+	git log --format="%gd: %gs" -g "$@" $ref_stash --
 }
 
 show_stash () {
-- 
1.6.5.116.gfe4b9
Previous: Nanako ShiraishiNext: Thomas Rast
Message 24 of 31 in “Pretty formats for reflog data”
  1. 0/5 Pretty formats for reflog dataThomas Rast, Oct 15, 2009
  2. 1/5 Refactor pretty_print_commit arguments into a structThomas Rast, Oct 15, 2009
  3. 2/5 reflog-walk: refactor the branch@{num} formattingThomas Rast, Oct 15, 2009
  4. 3/5 Introduce new pretty formats %g[sdD] for reflog informationThomas Rast, Oct 15, 2009
  5. Jeff KingOct 16, 2009
  6. Thomas RastOct 16, 2009
  7. 0/5 Pretty formats for reflog dataThomas Rast, Oct 16, 2009
  8. 1/5 Refactor pretty_print_commit arguments into a structThomas Rast, Oct 16, 2009
  9. Junio C HamanoOct 17, 2009
  10. Thomas RastOct 18, 2009
  11. Junio C HamanoOct 18, 2009
  12. 0/5 Pretty formats for reflog dataThomas Rast, Oct 19, 2009
  13. 1/5 Refactor pretty_print_commit arguments into a structThomas Rast, Oct 19, 2009
  14. 2/5 reflog-walk: refactor the branch@{num} formattingThomas Rast, Oct 19, 2009
  15. 3/5 Introduce new pretty formats %g[sdD] for reflog informationThomas Rast, Oct 19, 2009
  16. 4/5 stash list: use new %g formats instead of sedThomas Rast, Oct 19, 2009
  17. 5/5 stash list: drop the default limit of 10 stashesThomas Rast, Oct 19, 2009
  18. 2/5 reflog-walk: refactor the branch@{num} formattingThomas Rast, Oct 16, 2009
  19. 3/5 Introduce new pretty formats %g[sdD] for reflog informationThomas Rast, Oct 16, 2009
  20. 3/5 Introduce new pretty formats %g[sdD] for reflog informationThomas Rast, Oct 17, 2009
  21. Jakub NarebskiOct 17, 2009
  22. Jeff KingOct 18, 2009
  23. Nanako ShiraishiOct 18, 2009
  24. 4/5 stash list: use new %g formats instead of sedThomas Rast, Oct 16, 2009
  25. 5/5 stash list: drop the default limit of 10 stashesThomas Rast, Oct 16, 2009
  26. Junio C HamanoOct 17, 2009
  27. Jeff KingOct 17, 2009
  28. 4/5 stash list: use new %g formats instead of sedThomas Rast, Oct 15, 2009
  29. 5/5 stash list: drop the default limit of 10 stashesThomas Rast, Oct 15, 2009
  30. Jeff KingOct 16, 2009
  31. Jakub NarebskiOct 16, 2009

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.