From: Daniel Martí Date: Mon, 17 Jun 2013 22:18:38 +0000 (+0200) Subject: Add first commitupdate script version X-Git-Tag: 0.1~530 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=5551ba3d5ed5622d05363bcad672ed77c1ab1e98;p=fdroidserver.git Add first commitupdate script version --- diff --git a/commitupdate b/commitupdate new file mode 100755 index 00000000..675c8e14 --- /dev/null +++ b/commitupdate @@ -0,0 +1,31 @@ +#!/bin/bash + +while read line; do + if [[ "$line" == *M*metadata/*.txt ]]; then + file=${line##* } + + newbuild=0 + while read l; do + if [[ "$l" == "+Build Version:"* ]]; then + newbuild=1 + build=${l#*:} + version=${build%%,*} + build=${build#*,} + vercode=${build%%,*} + fi + done < <(git diff -- "$file") + + [ $newbuild -eq 0 ] && continue + + while read l; do + [[ "$l" == "Auto Name:"* ]] && name=${l##*:} + done < "$file" + + id=${file##*/} + id=${id%.txt*} + [ -n "$name" ] && id="$name ($id)" + + echo "> git commit -m \"Update $id to $version ($vercode)\" -- \"$file\"" + git commit -m "Update $id to $version ($vercode)" -- "$file" + fi +done < <(git status --porcelain)