Tests redirect to err file when grepping stderr
[stgit.git] / contrib / stg-show
bloba55e7b9dc9971b4f3f3ce6b9c7b9730093532107
1 #!/bin/bash
2 set -e
4 # stg-show - unlike "stg show", just "git show" with knowledge of stg refs
6 # Ex:
7 # stg-show --color-words -- files
9 # Copyright (c) 2007 Yann Dirson <ydirson@altern.org>
10 # Subject to the GNU GPL, version 2.
12 command=(git show)
14 # subsitute git id's for stg ones until --
15 while [ "$#" -gt 0 ]; do
16 case "$1" in
17 --) break ;;
18 -*) command+=("$1"); shift ;;
19 *) command+=( $(stg id "$1" 2>/dev/null || echo "$1") ); shift ;;
20 esac
21 done
23 # append remaining args
24 command+=("$@")
26 eval "${command[@]}"