chiark / gitweb /
commitupdates now treats all other changes in a generic manner
authorDaniel Martí <mvdan@mvdan.cc>
Wed, 30 Oct 2013 19:17:56 +0000 (20:17 +0100)
committerDaniel Martí <mvdan@mvdan.cc>
Wed, 30 Oct 2013 19:17:56 +0000 (20:17 +0100)
tools/commitupdates

index bd4480033057d9a975affdc4341049120a17d3f2..e1445a475e4b8e3119c042e84f190b15c15a0ea4 100755 (executable)
@@ -8,15 +8,18 @@ while read line; do
     if [[ "$line" == *M*metadata/*.txt ]]; then
         file=${line##* }
 
+        while read l; do
+            [[ "$l" == "Auto Name:"* ]] && name=${l##*:}
+        done < "$file"
+
+        id=${file##*/}
+        id=${id%.txt*}
+        [ -d metadata/$id ] && extra=metadata/$id
+        [ -n "$name" ] && id="$name ($id)"
+
         newbuild=0
         while read l; do
-            if [[ "$l" == "+Build Version:"* ]]; then
-                newbuild=1
-                build=${l#*:}
-                version=${build%%,*}
-                build=${build#*,}
-                vercode=${build%%,*}
-            elif [[ "$l" == "+Build:"* ]]; then
+            if [[ "$l" == "+Build:"* ]]; then
                 newbuild=1
                 build=${l#*:}
                 version=${build%%,*}
@@ -25,18 +28,14 @@ while read line; do
             fi
         done < <(git diff HEAD -- "$file")
 
-        [ $newbuild -eq 0 ] && continue
-
-        while read l; do
-            [[ "$l" == "Auto Name:"* ]] && name=${l##*:}
-        done < "$file"
-
-        id=${file##*/}
-        id=${id%.txt*}
-        [ -d metadata/$id ] && extra=metadata/$id
-        [ -n "$name" ] && id="$name ($id)"
+        if [ $newbuild -eq 0 ]
+               then
+                       message="$id:"
+               else
+                       message="Update $id to $version ($vercode)"
+               fi
 
-        commands+=("git commit -m 'Update $id to $version ($vercode)' -e -v -- $file $extra")
+        commands+=("git commit -m '$message' -e -v -- $file $extra")
     fi
 done < <(git status --porcelain)