]> xenbits.xensource.com Git - people/andrewcoop/hwloc.git/commitdiff
If a git command fails, also print the repo in the error message
authorJeff Squyres <jsquyres@cisco.com>
Thu, 9 Jan 2014 14:34:24 +0000 (09:34 -0500)
committerJeff Squyres <jsquyres@cisco.com>
Thu, 9 Jan 2014 14:34:24 +0000 (09:34 -0500)
contrib/git/github-send-commit-mails.pl

index e908a306d6ca32befcb3aa6fe338dd2a009a3a0a..58f8cf714943c41d602b88518134e88f29728fad 100755 (executable)
@@ -8,14 +8,17 @@ die "Must specify location of source git repo"
     if ($#ARGV < 0);
 
 sub doit {
-    my ($cmd) = shift;
+    my ($cmd, $repo) = @_;
 
     my $rc;
     my $outfile = "/tmp/github-send-email-tmp.$$";
     unlink($outfile);
     $rc = system("$cmd >$outfile 2>&1");
     if (0 != $rc) {
-        print "Command failed: $cmd
+        print "Command failed:
+
+Command: $cmd
+Repo:    $repo
 Output:\n";
         open(IN, $outfile);
         print $_
@@ -33,7 +36,7 @@ foreach my $src_repo (@ARGV) {
     die "Could not chdir to $src_repo"
         if (getcwd() != $src_repo);
 
-    doit("/u/mpiteam/git/local/bin/git fetch");
-    doit("/u/mpiteam/git/local/bin/git push email");
+    doit("/u/mpiteam/git/local/bin/git fetch", $src_repo);
+    doit("/u/mpiteam/git/local/bin/git push email", $src_repo);
 }