Skip to content

Commit

Permalink
stash list: use new %g formats instead of sed
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Thomas Rast authored and Junio C Hamano committed Oct 20, 2009
1 parent 8f8f547 commit 391c53b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions git-stash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down

0 comments on commit 391c53b

Please sign in to comment.