3 #=======================================================================
5 # File ID: 6553a34c-1194-11e2-97b0-fefdb24f8e10
7 # List all branches except those containing "commit-[0-9a-f]{40}" .
8 # Can be used for things like this:
10 # git log `git branch -a | git nocom`
12 # Author: Øyvind A. Holm <sunny@sunbase.org>
13 # License: GNU General Public License version 2 or later.
14 #=======================================================================
30 " -n "$progname" -- "$@
")"
31 test "$?" = "0" ||
exit 1
40 -h|
--help) opt_help
=1; shift ;;
41 -q|
--quiet) opt_quiet
=$
(($opt_quiet + 1)); shift ;;
42 -r|
--reverse) opt_reverse
=1; shift ;;
43 -v|
--verbose) opt_verbose
=$
(($opt_verbose + 1)); shift ;;
44 --version) echo $progname $VERSION; exit 0 ;;
46 *) echo $progname: Internal error
>&2; exit 1 ;;
49 opt_verbose
=$
(($opt_verbose - $opt_quiet))
51 if test "$opt_help" = "1"; then
52 test $opt_verbose -gt 0 && { echo; echo $progname $VERSION; }
55 List all branches except those containing "commit-[0-9a-f]{40}" .
56 Can be used for things like this:
58 git log \`git branch -a | git nocom\`
60 Usage: $progname [options]
67 Be more quiet. Can be repeated to increase silence.
69 Reverse the behaviour, only display commit-* branches.
71 Increase level of verbosity. Can be repeated.
73 Print version information.
80 test "$opt_reverse" = "1" || v_str
=-v
81 grep -v "HEAD detached" |
84 grep -v -E '^(->|\*|.*/HEAD)$' |
85 grep -E $v_str 'commit-[0-9a-f]{40}'