Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100755 28 lines (23 sloc) 0.492 kB
a794af7 @mjdominus Add git-treehash
authored
1 #!/usr/bin/perl
2
3 my %opt;
4 use Getopt::Std;
5 getopts("q", \%opt);
6
7 @ARGV = qw(HEAD ORIG_HEAD) unless @ARGV;
8
9 for my $rev (@ARGV) {
10 chomp(my $res = qx{git rev-parse $rev^{tree}});
11 if ($?) { $BAD++ }
12 else { push @{$hash{$res}}, $rev }
13 }
14
15 exit 2 if $BAD;
16 if (keys(%hash) == 1) {
17 my ($res) = keys %hash;
18 print "$res\n" unless $opt{"q"};
19 exit 0;
20 } else {
21 unless ($opt{"q"}) {
22 for my $res (keys %hash) {
23 print $res, " ", join(" ", @{$hash{$res}}), "\n";
24 }
25 }
26 exit 1;
27 }
Something went wrong with that request. Please try again.