chiark / gitweb /
put die() messages to stderr
[topgit.git] / tg-export.sh
index 5b7794c..6d82d55 100644 (file)
@@ -67,10 +67,9 @@ trap 'rm -rf "$playground"' EXIT
 # Output tree ID of a cleaned-up tree without tg's artifacts.
 pretty_tree()
 {
-       (export GIT_INDEX_FILE="$playground/^index"
-        git read-tree "$1"
-        git update-index --force-remove ".topmsg" ".topdeps"
-        git write-tree)
+       git ls-tree --full-tree "$1" \
+       | awk -F '      ' '$2 !~ /^.top/' \
+       | git mktree
 }
 
 create_tg_commit()
@@ -185,8 +184,8 @@ quilt()
                echo "Skip empty patch $_dep";
        else
                if "$numbered"; then
-                       number="$(printf "%04u" $(($(cat "$playground/^number" 2>/dev/null) + 1)))";
-                       bn="$number-$bn";
+                       number="$(echo $(($(cat "$playground/^number" 2>/dev/null) + 1)))";
+                       bn="$(printf "%04u-$bn" $number)";
                        echo "$number" >"$playground/^number";
                fi;