[RFC PATCH 3/5] stash: Use new %g/%G formats instead of sed
- From
Thomas Rast <trast@student.ethz.ch>
- Date
- Oct 12, 2009, 21:06 UTC
- Message-ID
- <77e591b80021efc265fea1a101ce6b7124ea832e.1255380039.git.trast@student.ethz.ch>
- In-Reply-To
- <cover.1255380039.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..8fbf10a 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="%g: %G" -g "$@" $ref_stash } show_stash () {
-- 1.6.5.64.g01287