From: Rudolf Polzer Date: Wed, 27 Mar 2013 08:17:12 +0000 (+0100) Subject: help message X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fdiv0-gittools.git;a=commitdiff_plain;h=ffc02d87b626995e8e24fd0703d6dcfef95c78c8;hp=8a57b4a8d797b7ae98de93fa87848631875597ff help message --- diff --git a/git-identify-revision b/git-identify-revision index 64e9495..e71c259 100755 --- a/git-identify-revision +++ b/git-identify-revision @@ -4,16 +4,38 @@ # arguments: git rev-list arguments # we now identify the one revision with least differences +usage() +{ + echo "Usage: $0 [--cached] git-rev-list args..." + echo + echo "Example: $0 --all" + echo "Compares current work tree to all revisions, and identifies the" + echo "closest match." + echo + echo "Example: $0 --cached v1.0..HEAD" + echo "Compares current work tree to all revisions between v1.0 and HEAD," + echo "and identifies the closest match." +} + case "$1" in --cached) use_worktree=false shift ;; + --help|-h) + usage + exit 0 + ;; *) use_worktree=true ;; esac +if [ $# = 0 ]; then + usage >&2 + exit 1 +fi + diffopts="-M -C" if $use_worktree; then