chiark / gitweb /
commitid.scad.pl: introduce genform_prep to reset form generator info (nfc)
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 12 Feb 2016 01:45:56 +0000 (01:45 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 12 Feb 2016 01:45:56 +0000 (01:45 +0000)
commitid.scad.pl

index 8bd4aa71e507d46b1ae6e5a2d588e8a9ac4499f2..7245373abcfe7d82d5cc060323cf4d2785a8006e 100755 (executable)
@@ -449,6 +449,9 @@ sub ljustt ($$$;$) {
     return sprintf "%-${sz}.${sz}s%s", $whole, $suffix;
 }
 
+sub genform_prep() {
+}
+
 sub genform ($@) {
     my ($form, @lines) = @_;
     gentextmodule($form, @lines);
@@ -538,6 +541,7 @@ sub do_git () {
        gentextmodule_demo_start_batch();
 
        if (defined($git_count)) {
+           genform_prep();
            my $smallstr = rjustt($sz, 'Count', $git_count, $git_dirty);
            my $forgitobj = $sz - length($git_count) - 1;
            if (defined($git_object) && $forgitobj >= 2) {
@@ -548,14 +552,17 @@ sub do_git () {
            genform_plusq("Small$sz", $smallstr);
        }
 
+       genform_prep();
        genform_plusq("Git$sz", ljustt($sz, 'Objid', $git_object, $git_dirty))
            if defined $git_object;
 
        if (defined $git_count && defined $git_object) {
+           genform_prep();
            genform("Full".($sz*2),
                    ljustt($sz, 'Objid', $git_object),
                    rjustt($sz, 'Count', $git_count, $git_dirty));
 
+           genform_prep();
            my $e = $sz;
            genform("Full".($e*3)."T",
                    ljustt($e*2, 'Objid', $git_object, $git_dirty)