SHARE
TWEET

Untitled

a guest Apr 24th, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/sh
  2.  
  3. COMMIT_MSG_FILE=$1
  4. COMMIT_SOURCE=$2
  5. SHA1=$3
  6.  
  7. # Merging branch (could use GIT_MERGE file)
  8. if grep -q "Merge branch "; then
  9.     exit
  10. fi
  11.  
  12. # Amending
  13. if [ ! -z "$SHA1" ]; then
  14.     exit
  15. fi
  16.  
  17. PREFIX=$(git log -n 5 --pretty=%B | grep ": " | cut -d " " -f1 | head -n 1)
  18.  
  19. if -z "$PREFIX"; then
  20.     exit
  21. fi
  22.  
  23. sed -i "1i $PREFIX " "$COMMIT_MSG_FILE"
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top