Add git-project-gitk.sh
authorHugo Villeneuve <hugo@hugovil.com>
Wed, 15 Apr 2020 14:53:45 +0000 (10:53 -0400)
committerHugo Villeneuve <hugo@hugovil.com>
Wed, 15 Apr 2020 19:52:13 +0000 (15:52 -0400)
scripts/Makefile.am
scripts/avi2mp4
scripts/git-project-gitk.sh [new file with mode: 0755]

index 91a359e..9379273 100644 (file)
@@ -30,6 +30,7 @@ dist_bin_SCRIPTS = \
     git-project-update.sh \
     git-project-clone.sh \
     git-project-tag.sh \
+    git-project-gitk.sh \
     source-code-stats \
     flac2ogg flac2mp3 \
     hv-scan \
index c9c3042..cf69f8b 100755 (executable)
@@ -6,7 +6,7 @@ VIDEO_OPTS="-c:v libx264 -preset veryslow -crf 15"
 
 print_usage()
 {
-    echo "${PROG_NAME} -- Conversion AVI à MP4 (x264)"
+    echo "${PROG_NAME} -- Conversion MP4 (x264)"
     echo "Usage: ${PROG_NAME} [OPTIONS...] FICHIER"
     echo
     echo "Options:"
@@ -68,6 +68,8 @@ if [ ! -f $1 ]; then
     exit 1
 fi
 
-dest=`echo "${src}" | sed s/\.avi$/.mp4/g`
+# Cut everything after the last dot using sed:
+dest=`echo "${src}" | sed s/\.[^.]*$//`
+dest="${dest}.mp4"
 
 ffmpeg -i "${src}" ${VIDEO_OPTS} ${audio_opts} "${dest}"
diff --git a/scripts/git-project-gitk.sh b/scripts/git-project-gitk.sh
new file mode 100755 (executable)
index 0000000..5d698d9
--- /dev/null
@@ -0,0 +1,42 @@
+#!/bin/bash
+
+SCRIPT="`readlink -e $0`"
+SCRIPTPATH=$(dirname ${SCRIPT})
+source ${SCRIPTPATH}/hv-git-functions.sh
+
+print_usage()
+{
+    echo "$(basename $0) -- Start gitk for each subrepository"
+    echo "Usage: $(basename $0) [OPTIONS...]"
+}
+
+if [ "x${1}" = "x--help" ]; then
+    print_usage
+    exit 1
+fi
+
+if [ ${#} -ne 0 ]; then
+    echo "Unsupported argument(s)"
+    print_usage
+    exit 1
+fi
+
+hv_git_validate_subrepos_list
+
+branch=${1}
+rc=0
+
+for r in ./ $(hv_git_get_subrepos_list); do
+    # Make sure directory exists
+    if [ ! -d "${r}" ]; then
+        echo "Skipping missing repos ${r}"
+        continue
+    fi
+
+    pushd ${r} 1> /dev/null
+    gitk &
+    popd 1> /dev/null
+    rc=${?}
+done
+
+exit ${rc}