#!/usr/bin/perl -w # extract commits from a git repo, produce email body # use strict; if ($#ARGV != 0) { print STDERR "Usage: git-make-xfs \n"; exit 1; } my $parent_tree = $ARGV[0]; my $first_commit; my $final_parent; my $changes; open CHANGES, "git-changes-script -L $parent_tree |" or die "git-changes-script"; while () { if (/^commit (\S+)$/) { $first_commit = $1 if !defined($first_commit); } elsif (/^parent (\S+)$/) { $final_parent = $1; } $changes .= $_; } close CHANGES; if (!defined($changes)) { print "No differences.\n"; exit 0; } print "Please pull from:\n"; print "\tgit://oss.sgi.com:8090/oss/git/xfs-2.6.git\n"; print "\n"; print "This will update the following files:\n"; print "\n"; open DIFFSTAT, "git-export $first_commit $final_parent | diffstat -p1 |" or die "git-export | diffstat"; while () { print; } close DIFFSTAT; print "\n"; print "through these commits:\n"; print "\n"; print $changes;