X-Git-Url: https://arthur.barton.de/gitweb/?a=blobdiff_plain;f=format-subst.pl;h=8a331bff2942008869476064f603feac82fbcbe1;hb=refs%2Fheads%2Fcleanup-messages;hp=e91c3b8ad7f8cf23c5ca660ba1ca13db2e3ce3b2;hpb=67a38a4671e1b81ffd96b4109395a51cc2f4bbcb;p=bup.git diff --git a/format-subst.pl b/format-subst.pl index e91c3b8..8a331bf 100755 --- a/format-subst.pl +++ b/format-subst.pl @@ -8,18 +8,25 @@ sub fix($) { return $s; } +sub ex +{ + my ($cmd) = @_; + my $result = `$cmd` or die 'FAILED: ' . $cmd; + return $result; +} + while (<>) { s{ \$Format:\%d\$ }{ - my $tag = fix(`git describe --match="[0-9]*"`); + my $tag = fix(ex('git describe --match="[0-9]*"')); "(tag: bup-$tag)" }ex; s{ \$Format:([^\$].*)\$ }{ - fix(`git log -1 --pretty=format:"$1"`) + fix(ex("git log -1 --pretty=format:'$1'")) }ex; print; }