Ajout script vb (version control list branches)
authorHugo Villeneuve <hugo@hugovil.com>
Thu, 20 Jun 2013 21:39:08 +0000 (17:39 -0400)
committerHugo Villeneuve <hugo@hugovil.com>
Thu, 20 Jun 2013 21:39:08 +0000 (17:39 -0400)
scripts/Makefile.am
scripts/vb [new file with mode: 0755]

index 476da1f..63baeb0 100644 (file)
@@ -18,7 +18,7 @@ dist_bin_SCRIPTS = \
     setdate \
     strip-debug-symbols \
     tildes-clean \
-    vd vs vl \
+    vb vd vl vs \
     flac2ogg flac2mp3 \
     hv-scan \
     tape-backup tape-backup-mult tape-list tape-restore
diff --git a/scripts/vb b/scripts/vb
new file mode 100755 (executable)
index 0000000..8473adf
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+VCS_SUPPORTED="GIT or Mercurial"
+
+print_usage()
+{
+    echo "$(basename $0) -- branches list for version control (${VCS_SUPPORTED})."
+    echo "Usage: $(basename $0) [OPTIONS...]"
+}
+
+if [ "x${1}" = "x--help" ]; then
+    print_usage
+    exit 1
+fi
+
+if git diff 1> /dev/null 2>&1; then
+    git branch -a "$@"
+elif hg status 1> /dev/null 2>&1; then
+    hg branches "$@"
+else
+    echo "Not a ${VCS_SUPPORTED} repository"
+    exit 1
+fi