Last active
July 9, 2020 06:48
-
-
Save inverse/d0de698a88bfc7e392daec12b0d028f5 to your computer and use it in GitHub Desktop.
Revisions
-
inverse revised this gist
Jul 9, 2020 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,4 +10,3 @@ BRANCH_IN_COMMIT=$(grep -c "\[$BRANCH_NAME\]" $1) if [ -n "$BRANCH_NAME" ] && [[ $BRANCH_NAME =~ ^([A-Z]+-[0-9]+)(\-.+)?$ ]] && ! [[ $BRANCH_IN_COMMIT -ge 1 ]]; then sed -i.bak -e "1s/^/[${BASH_REMATCH[1]}] /" $1 fi -
inverse revised this gist
Mar 12, 2020 . 1 changed file with 3 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,6 +7,7 @@ BRANCH_NAME="${BRANCH_NAME##*/}" BRANCH_IN_COMMIT=$(grep -c "\[$BRANCH_NAME\]" $1) if [ -n "$BRANCH_NAME" ] && [[ $BRANCH_NAME =~ ^([A-Z]+-[0-9]+)(\-.+)?$ ]] && ! [[ $BRANCH_IN_COMMIT -ge 1 ]]; then sed -i.bak -e "1s/^/[${BASH_REMATCH[1]}] /" $1 fi malac -
inverse revised this gist
Oct 1, 2019 . 1 changed file with 1 addition and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,11 +1,10 @@ #!/bin/bash # Prepend branch name to commit message in [] if matching regex. e.g. DEN-123 BRANCH_NAME=$(git symbolic-ref --short HEAD) BRANCH_NAME="${BRANCH_NAME##*/}" BRANCH_IN_COMMIT=$(grep -c "\[$BRANCH_NAME\]" $1) if [ -n "$BRANCH_NAME" ] && [[ $BRANCH_NAME =~ ^[A-Z]+-[0-9]+$ ]] && ! [[ $BRANCH_IN_COMMIT -ge 1 ]]; then -
inverse created this gist
Jun 12, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ #!/bin/bash # Prepend branch name to commit message in [] BRANCH_NAME=$(git symbolic-ref --short HEAD) BRANCH_NAME="${BRANCH_NAME##*/}" BRANCH_EXCLUDED=$(printf "%s\n" "${BRANCHES_TO_SKIP[@]}" | grep -c "^$BRANCH_NAME$") BRANCH_IN_COMMIT=$(grep -c "\[$BRANCH_NAME\]" $1) if [ -n "$BRANCH_NAME" ] && [[ $BRANCH_NAME =~ ^[A-Z]+-[0-9]+$ ]] && ! [[ $BRANCH_IN_COMMIT -ge 1 ]]; then sed -i.bak -e "1s/^/[$BRANCH_NAME] /" $1 fi