]> arthur.barton.de Git - bup.git/blob - format-subst.pl
git log --format= isn't in older git, but git log --pretty=format: is.
[bup.git] / format-subst.pl
1 #!/usr/bin/env perl
2 use warnings;
3 use strict;
4
5 sub fix($) {
6     my $s = shift;
7     chomp $s;
8     return $s;
9 }
10
11 while (<>) {
12     s{
13         \$Format:\%d\$
14     }{
15         my $tag = fix(`git describe --match="bup-*"`);
16         "(tag: $tag)"
17     }ex;
18     
19     s{ 
20         \$Format:([^\$].*)\$
21     }{
22         fix(`git log -1 --pretty=format:"$1"`)
23     }ex;
24     print;
25 }