github.com/olivere/camlistore@v0.0.0-20140121221811-1b7ac2da0199/misc/review (about)

     1  #!/usr/bin/perl
     2  
     3  use strict;
     4  use FindBin qw($Bin);
     5  
     6  my $hook_file = "$Bin/../.git/hooks/commit-msg";
     7  
     8  unless (-e $hook_file) {
     9      print <<EOF;
    10  Presubmit hook to add Change-Id to commit messages is missing.
    11  Copying to $hook_file.
    12  EOF
    13  
    14  system("cp", "-p", "$Bin/commit-msg.githook", $hook_file) and die "cp failed.\n";
    15  
    16      print <<EOF;
    17  Amending last commit to add Change-Id.
    18  Please re-save description without making changes.
    19  
    20  Press Enter to continue.
    21  EOF
    22  
    23  scalar(<STDIN>);
    24  
    25      system("git", "commit", "--amend") and die "git commit --amend fail\n";
    26  }
    27  
    28  exec("git", "push", "https://camlistore.googlesource.com/camlistore", "HEAD:refs/for/master");