Created
July 6, 2010 15:04
-
-
Save dagolden/465492 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Checks that any files added are also added to the MANIFEST | |
if git-rev-parse --verify HEAD 2>/dev/null | |
then | |
git diff-index -M --name-status HEAD -- | |
else | |
# NEEDSWORK: we should produce a diff with an empty tree here | |
# if we want to do the same verification for the initial import. | |
: | |
fi | | |
/usr/bin/perl -we ' | |
my @added; | |
while (<>) { | |
my ($status, $name) = split /\s+/; | |
push @added, $name if $status eq "A"; | |
} | |
exit 0 unless @added; | |
open my $fh, "<", "MANIFEST"; | |
my %manifest = map { $_ => 1 } map { m{^(\S+)\s} } <$fh>; | |
my @missing = grep { ! $manifest{$_} } @added; | |
exit 0 unless @missing; | |
die "Files are missing from MANIFEST:\n" . join("\n",@missing) . "\n"; | |
' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment