chiark / gitweb /
commitid.scad.pl: Provide more Full*T
[reprap-play.git] / commitid.scad.pl
index fbeed6fe1a4518f42374901c003303f342b3d7c3..9b344e264aba88966800a0694f818bd4a1e36cf4 100755 (executable)
@@ -105,10 +105,7 @@ $SIG{__WARN__} = sub { die @_; };
 #            Full6    abcdef       Full8     abcdef01
 #                     23456*                 _123456*
 #
-#   Full6T
-#   Full9T
-#   Full12T
-#   Full15T
+#   Full6T Full9T Full12T ... Full30T
 #       as Full but commit is split over two lines
 #       for a 3-line message; eg
 #             Full9T    abc
@@ -275,8 +272,8 @@ sub rjustt ($$;$) { # right justify and truncate (ie, pad and truncate at left)
     my $lw = length $whole;
     my $spare = $sz - $lw - (length $prefix);
     return
-       $prefix.
        ($spare > 0 ? (' ' x $spare) : '').
+       $prefix.
        substr($whole, ($spare < 0 ? -$spare : 0));
 }
 
@@ -361,7 +358,7 @@ sub do_git () {
     foreach my $sz (3..10) {
        gentextmodule_demo_start_batch($sz-3);
 
-       gentextmodule_plusq("Small$sz", rjustt($sz, $git_count.$git_dirty))
+       gentextmodule_plusq("Small$sz", rjustt($sz, $git_count$git_dirty))
            if defined $git_count;
 
        gentextmodule_plusq("Git$sz", ljustt($sz, $git_object, $git_dirty))
@@ -369,16 +366,14 @@ sub do_git () {
 
        if (defined $git_count && defined $git_object) {
            gentextmodule("Full$sz",
-                         ljustt($sz, $git_object, ''),
-                         rjustt($sz, $git_count.$git_dirty));
-
-           if (!($sz % 2)) {
-               my $e = $sz/2;
-               gentextmodule("Full".($e*3)."T",
-                             ljustt($e*2, $git_object, $git_dirty)
-                             =~ m/.{$e}/g,
-                             rjustt($e, $git_count));
-           }
+                         ljustt($sz, $git_object),
+                         rjustt($sz, $git_count, $git_dirty));
+
+           my $e = $sz;
+           gentextmodule("Full".($e*3)."T",
+                         ljustt($e*2, $git_object, $git_dirty)
+                         =~ m/.{$e}/g,
+                         rjustt($e, $git_count));
        }
     }
 }