|
|
| File: [Development] / xfs-cmds / xfsmisc / Attic / git-make-xfs (download)
Revision 1.2, Tue Mar 14 02:50:45 2006 UTC (11 years, 7 months ago) by nathans.longdrop.melbourne.sgi.com
Update to recent versions of git, handle no-changes case. Merge of master-melb:xfs-cmds:25444a by kenmcd. |
#!/usr/bin/perl -w
# extract commits from a git repo, produce email body
#
use strict;
if ($#ARGV != 0) {
print STDERR "Usage: git-make-xfs </path/to/git-parent>\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 (<CHANGES>) {
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 (<DIFFSTAT>) { print; }
close DIFFSTAT;
print "\n";
print "through these commits:\n";
print "\n";
print $changes;