Skip to content

Instantly share code, notes, and snippets.

@spannerinworks
Created April 30, 2013 15:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spannerinworks/5489488 to your computer and use it in GitHub Desktop.
Save spannerinworks/5489488 to your computer and use it in GitHub Desktop.
git hook to prepend story number to commit messages
#!/usr/bin/perl -pi
$branch = `git symbolic-ref HEAD`;
chomp($branch);
$branch =~ s|^refs/heads/(MYC.\d+).*|\1|;
print "[${branch}] " if ($. == 1 && $branch =~ /^MYC.\d+$/);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment