Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- # usage: git ls-tree -r HEAD | $PROGRAM_NAME
- use strict;
- use warnings;
- my $sha1_path = {};
- while (my $line = <STDIN>) {
- chomp $line;
- if ($line =~ m{ A d+ s+ w+ s+ (w+) s+ (S+) z }xms) {
- my $sha1 = $1;
- my $path = $2;
- push @{$sha1_path->{$sha1}}, $path;
- }
- }
- foreach my $sha1 (keys %$sha1_path) {
- if (scalar @{$sha1_path->{$sha1}} > 1) {
- foreach my $path (@{$sha1_path->{$sha1}}) {
- print "$sha1 $pathn";
- }
- print '-' x 40, "n";
- }
- }
- git ls-tree -r HEAD |
- sort -t ' ' -k 3 |
- perl -ne '$1 && / $1t/ && print "e[0;31m" ; / ([0-9a-f]{40})t/; print "$_e[0m"'
- git ls-tree -r HEAD
Add Comment
Please, Sign In to add comment