Skip to content

Instantly share code, notes, and snippets.

@asiviero
Last active August 10, 2016 18:38
Show Gist options
  • Save asiviero/6241b8212fbe00a3c95cd759d4364f33 to your computer and use it in GitHub Desktop.
Save asiviero/6241b8212fbe00a3c95cd759d4364f33 to your computer and use it in GitHub Desktop.
#!/bin/sh
#
# Get the issue based on a WEB-\d+ regex and prepend it to the commit msg
issue=$(git symbolic-ref HEAD | sed -n 's/^.*\(WEB-[0-9][0-9]*\).*$/\1/p')
if [ -n "$issue" ]; then
echo -n "$issue " | cat - $1 > /tmp/out && mv /tmp/out $1
fi
@asiviero
Copy link
Author

Merci, @heybrun

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment