File: [Development] / xfs-cmds / xfsmisc / Attic / git-make-xfs (download)
Revision 1.6, Thu Aug 10 15:37:30 2006 UTC (11 years, 2 months ago) by nathans.longdrop.melbourne.sgi.com
Branch: MAIN
Changes since 1.5: +1 -0
lines
Update merge scripts slightly.
Merge of master-melb:xfs-cmds:26748a by kenmcd.
|
#!/usr/bin/perl -w
# extract commits from a git repo, produce email body
# <commitset> is created by p_mod2git
use strict;
my $commit1;
my $commit2;
my $parent1;
if ($#ARGV != 0) {
print STDERR "Usage: git-make-xfs <commitset>\n";
exit 1;
}
my $commitset = $ARGV[0];
open COMMITS, $commitset or die "cannot open commitset $commitset";
while (<COMMITS>) {
chomp;
if (!defined($commit1)) { $commit1 = $_; }
else { $commit2 = $_; }
}
close COMMITS;
if (!defined($commit2)) { $commit2 = $commit1; }
open PARENT1, "git-log --pretty=raw --max-count=1 $commit1 |" or die "git-log";
while (<PARENT1>) {
if (!defined($parent1) && m/^parent (\S+)$/) { $parent1 = $1; }
}
close PARENT1;
die "no parent for $commit1?\n" if (!defined($parent1));
print "Please pull from:\n";
print "\tgit://oss.sgi.com:8090/nathans/xfs-2.6\n";
print "\n";
print "This will update the following files:\n";
print "\n";
open STAT, "git-diff-tree --stat --no-commit-id $parent1 $commit2 |"
or die "git-diff-tree (diffstat)";
while (<STAT>) { print; }
close STAT;
print "\n";
print "through these commits:\n";
print "\n";
open CHANGES, "cat $commitset | git-diff-tree --stdin -v -s |"
or die "git-diff-tree (commits)";
while (<CHANGES>) { print; }
close CHANGES;
print STDERR "Completed: git-export\n";