]> git.donarmstrong.com Git - bin.git/blob - git-shortrev
add reset usb bus command
[bin.git] / git-shortrev
1 #!/bin/bash
2
3 _usage() {
4     echo "Usage: git shortrev <committish>" 1>&2
5     exit 1
6 }
7
8 _shortrev() {
9     commit="${1:-HEAD}"
10     name="$(git name-rev --name-only "$commit")";
11     rev="$(git rev-parse --short "$commit")";
12     echo "$name@$rev";
13 }
14
15 case $# in
16     1 ) _shortrev "$1";;
17     0 ) _shortrev;;
18     * ) _usage
19 esac