diff options
author | Brandon Bayer <bbayer@multitech.com> | 2016-09-29 17:33:32 -0500 |
---|---|---|
committer | Brandon Bayer <bbayer@multitech.com> | 2016-09-29 17:33:32 -0500 |
commit | 5c7cb7bd713df635c921759e32673e2fa4a14592 (patch) | |
tree | 8907c8c7d0afd06a3254fde3d369ad354d2a9dff | |
parent | af516c587b8021a330d525304b19276c78ab0182 (diff) | |
download | mlinux-5c7cb7bd713df635c921759e32673e2fa4a14592.tar.gz mlinux-5c7cb7bd713df635c921759e32673e2fa4a14592.tar.bz2 mlinux-5c7cb7bd713df635c921759e32673e2fa4a14592.zip |
chore: improve pre-commit/pre-push git hook error messages
-rwxr-xr-x | scripts/git-hooks/pre-commit | 9 | ||||
-rwxr-xr-x | scripts/git-hooks/pre-push | 9 |
2 files changed, 14 insertions, 4 deletions
diff --git a/scripts/git-hooks/pre-commit b/scripts/git-hooks/pre-commit index f930ca7..ee010cb 100755 --- a/scripts/git-hooks/pre-commit +++ b/scripts/git-hooks/pre-commit @@ -6,10 +6,15 @@ if [ "$currentBranch" == "master" ]; then gitlabOccurances=$(grep -c -m1 gitlab .gitmodules) if [ $gitlabOccurances -eq 1 ]; then - echo "COMMIT INVALID: You can't commit anything to the master branch that pulls + echo " +************************************************************************* +COMMIT INVALID: .gitmodules has a reference to GitLab + +You can't commit anything to the master branch that pulls from GitLab because outsiders won't be able to build it. -If you need to use a submodule from GitLab, do so from a branch." +If you need to use a submodule from GitLab, do so from a branch. +*************************************************************************" exit 1 fi fi diff --git a/scripts/git-hooks/pre-push b/scripts/git-hooks/pre-push index 85b5095..9cacb8f 100755 --- a/scripts/git-hooks/pre-push +++ b/scripts/git-hooks/pre-push @@ -6,10 +6,15 @@ if [ "$currentBranch" == "master" ]; then gitlabOccurances=$(grep -c -m1 gitlab .gitmodules) if [ $gitlabOccurances -eq 1 ]; then - echo "PUSH ERROR: You can't push anything to the master branch that pulls + echo " +************************************************************************* +PUSH ERROR: .gitmodules has a reference to GitLab + +You can't push anything to the master branch that pulls from GitLab because outsiders won't be able to build it. -If you need to use a submodule from GitLab, do so from a branch." +If you need to use a submodule from GitLab, do so from a branch. +*************************************************************************" exit 1 fi fi |