#!/usr/bin/perl -w use strict; use File::Basename; use File::Spec; -d '.git' or die "$0: Not a Git repository"; my $root = dirname($0); my $last = `(cd $root; git ls-files "whats" | tail -1)`; @ARGV = ("$root/$last"); my $output_file = "GH-PAGES/index.html"; open STDOUT, ">", $output_file or die "$0: Failed to open $output_file for writing: $!\n"; my %cooking; my $current; if (@ARGV) { while (<>) { next if /^-------/; next if m/^\[([^\]]*)\]/; if (/^[*] (\S+)/) { $current = $1; $cooking{$current} = ""; next; } next if /^ [+-]/; next unless $current; $cooking{$current} .= $_ unless /^\s*$/ && $cooking{$current} eq ''; } } my $title = "Currently in the 'pu' branch"; print <<"END"; $title

$title

\n"; print "\n"; print "\n"; close STDOUT; system qq(cd GH-PAGES; git commit --amend -m "Update index.html" index.html >/dev/null);