-
-
Save imarcelolz/52ff09bd72f566f7f88f1fd64339f7b5 to your computer and use it in GitHub Desktop.
Revisions
-
bartoszmajsak revised this gist
Oct 15, 2014 . 1 changed file with 6 additions and 4 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 @@ -2,14 +2,16 @@ # This way you can customize which branches should be skipped when # prepending commit message. if [ -z "$BRANCHES_TO_SKIP" ]; then BRANCHES_TO_SKIP=(master develop test) fi 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_EXCLUDED -eq 1 ]] && ! [[ $BRANCH_IN_COMMIT -ge 1 ]]; then sed -i.bak -e "1s/^/[$BRANCH_NAME] /" $1 fi -
bartoszmajsak revised this gist
Sep 22, 2014 . 1 changed file with 5 additions and 4 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,14 +1,15 @@ #!/bin/bash # This way you can customize which branches should be skipped when # prepending commit message. DEFAULT_BRANCHES_TO_SKIP=(master develop test) if [ -z "$BRANCHES_TO_SKIP" ]; then BRANCHES_TO_SKIP=$DEFAULT_BRANCHES_TO_SKIP fi BRANCH_NAME=$(git symbolic-ref --short HEAD) if [ -n "$BRANCH_NAME" ] && ! [[ ${BRANCHES_TO_SKIP[*]} =~ $BRANCH_NAME ]]; then BRANCH_NAME=${BRANCH_NAME##*/} sed -i.bak -e "1s/^/[$BRANCH_NAME] /" $1 fi -
bartoszmajsak renamed this gist
Sep 19, 2014 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
bartoszmajsak renamed this gist
Sep 19, 2014 . 1 changed file with 1 addition 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 @@ -3,7 +3,7 @@ # This way you can customize which branches should be skipped when # prepending commit message. if [ -z "$BRANCHES_TO_SKIP" ]; then BRANCHES_TO_SKIP=("master" "develop" "test") fi BRANCH_NAME=$(git symbolic-ref --short HEAD) -
bartoszmajsak revised this gist
Sep 19, 2014 . 1 changed file with 1 addition 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 @@ -1,7 +1,7 @@ #!/bin/sh # This way you can customize which branches should be skipped when # prepending commit message. if [ -z "$BRANCHES_TO_SKIP" ]; then BRANCHES_TO_SKIP=("master" "develop" "test") fi -
bartoszmajsak revised this gist
Sep 19, 2014 . 1 changed file with 9 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 @@ -1,7 +1,14 @@ #!/bin/sh # This way you can customize which branches should be skipped when # preperending commit message. if [ -z "$BRANCHES_TO_SKIP" ]; then BRANCHES_TO_SKIP=("master" "develop" "test") fi BRANCH_NAME=$(git symbolic-ref --short HEAD) if [ -n "$BRANCH_NAME" ] && ! [[ ${BRANCHES_TO_SKIP[*]} =~ $BRANCH_NAME ]]; then BRANCH_NAME=${BRANCH_NAME##*/} sed -i.bak -e "1s/^/[$BRANCH_NAME] /" $1 fi -
bartoszmajsak revised this gist
Sep 18, 2014 . 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 @@ -2,5 +2,6 @@ BRANCH_NAME=$(git symbolic-ref --short HEAD) if [ -n "$BRANCH_NAME" ] && [ "$BRANCH_NAME" != "master" ]; then BRANCH_NAME=${BRANCH_NAME##*/} sed -i.bak -e "1s/^/[$BRANCH_NAME] /" $1 fi -
bartoszmajsak revised this gist
Nov 25, 2013 . 1 changed file with 2 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 @@ -1,6 +1,6 @@ #!/bin/sh BRANCH_NAME=$(git symbolic-ref --short HEAD) if [ -n "$BRANCH_NAME" ] && [ "$BRANCH_NAME" != "master" ]; then sed -i.bak -e "1s/^/[$BRANCH_NAME] /" $1 fi -
bartoszmajsak renamed this gist
Nov 7, 2012 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
bartoszmajsak revised this gist
Dec 13, 2011 . 1 changed file with 2 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 @@ -1,6 +1,6 @@ #!/bin/sh BRANCH_NAME=$(git branch 2>/dev/null | grep -e ^* | tr -d ' *') if [ -n "$BRANCH_NAME" ] && [ "$BRANCH_NAME" != "master" ]; then echo "[$BRANCH_NAME] $(cat $1)" > $1 fi -
bartoszmajsak created this gist
Nov 26, 2011 .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,6 @@ #!/bin/sh BRANCH_NAME=$(git branch 2>/dev/null | grep -e ^* | tr -d ' *') if [ -n "$BRANCH_NAME" ]; then echo "[$BRANCH_NAME] $(cat $1)" > $1 fi