4 $SIG{__WARN__} = sub { die @_; };
6 # We generate a physical indication of which commit was used.
8 # We can generate three forms:
16 # git rev-list --first-parent --count HEAD
17 # typically 3-4 characters but we allow for up to 6
24 # same but in two lines eg
31 # git-rev-list --first-parent --count HEAD
40 last if %cellmap && !m/\S/;
49 my @chrs = split / /, $_;
50 <DATA> !~ m/\S/ or die;
51 foreach my $row (0..4) {
55 $_ .= ' ' x (@chrs * 4);
61 foreach my $chr (@chrs) {
62 s{^ }{} or die "$chr $_ ?";
63 foreach my $col (0..2) {
69 $f =~ s/\b\d/ sprintf '%x', $col*2 + $& /ge;
70 $f =~ s/\d\b/ sprintf '%x', $row*2 + $& /ge;
71 push @{ $chrpolys{$chr} }, [ split / /, $f ];
80 foreach my $polys (values %chrpolys) {
82 foreach my $p (@$polys) {
83 foreach my $ei (0..$#$p) {
84 my $e = $p->[$ei].$p->[($ei+1) % @$p];
86 $edges{$e} = [ $p, $ei ];
90 foreach my $pa (@$polys) {
91 foreach my $eai (0..$#$pa) {
92 my $ear = $pa->[ ($eai+1) % @$pa ].$pa->[$eai];
93 my $ebi = $edges{$ear};
97 # print "# merging $eai $ebi\n";
99 splice @$pa, $eai, 1, @$pb;
105 # @$polys = grep { @$_ } @$polys;
109 print Dumper(\%chrpolys);
126 /#\ # ##\ ##\ # # ### /## ### /#\ /#\
127 # # # # # # # # # # # # # #
128 # # # /#/ ### ### ##\ ##\ // >#< \##
129 # # # # # # # # # # # # #
130 \#/ # ### ##/ # ##/ \#/ # \#/ ##/
135 /## ##\ /## /## /## #
136 # # # # # # # # # ###
138 \## ##/ \## \## ### #