summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSytse Sijbrandij <sytses@gmail.com>2014-10-29 15:33:48 -0700
committerSytse Sijbrandij <sytses@gmail.com>2014-10-29 15:33:48 -0700
commit2892d4142cf6ed55f03171834000e33bd8c6bc94 (patch)
treef76c226b82fae93c230268b84612ea79c6dccb9a
parent44601bac008b61412b638236d59d18b1bcbddd65 (diff)
downloadgitlab-shell-better-comment-the-hooks.tar.gz
Put before exit so it is executed.better-comment-the-hooks
-rwxr-xr-xhooks/post-receive21
-rwxr-xr-xhooks/pre-receive20
2 files changed, 20 insertions, 21 deletions
diff --git a/hooks/post-receive b/hooks/post-receive
index befe213..8244d65 100755
--- a/hooks/post-receive
+++ b/hooks/post-receive
@@ -3,8 +3,7 @@
# This file was placed here by GitLab Shell.
# It is a shared file that is symlinked from all repositories.
# It makes sure that your pushed commits will be processed properly.
-# You can add your own hooks to by uncommenting the lines at the bottom.
-# If you upgrade GitLab Shell you will have to redo your changes.
+# For instructions on how to add custom hooks see the comment below.
# Consider using project services of post-receive hooks
# See http://doc.gitlab.com/ce/integration/README.html
# Or use web hooks that trigger an external application
@@ -17,16 +16,16 @@ repo_path = Dir.pwd
require_relative '../lib/gitlab_post_receive'
if GitlabPostReceive.new(repo_path, key_id, changes).exec
+ ## How to add a custom hooks to some repositories:
+ ## 1) Put a file with custom code in the repository root directory.
+ ## 2) Uncomment the lines below.
+ ## 3) Replace 'project-specific-hook' with the name if the custom file.
+ ## 4) If you upgrade GitLab Shell you will have to redo your changes.
+ #
+ # if File.exists?('project-specific-hook')
+ # execute 'project-specific-hook'
+ # end
exit 0
else
exit 1
end
-
-## How to add a custom hooks to some repositories:
-## 1) Put a file with custom code in the repository root directory.
-## 2) Uncomment the lines below.
-## 3) Replace 'project-specific-hook' with the name if the custom file.
-#
-# if File.exists?('project-specific-hook')
-# execute 'project-specific-hook'
-# end
diff --git a/hooks/pre-receive b/hooks/pre-receive
index fe4ea4c..a3d777a 100755
--- a/hooks/pre-receive
+++ b/hooks/pre-receive
@@ -3,8 +3,7 @@
# This file was placed here by GitLab Shell.
# It is a shared file that is symlinked from all repositories.
# It makes sure that your pushed commits will be processed properly.
-# You can add your own hooks to by uncommenting the lines at the bottom.
-# If you upgrade GitLab Shell you will have to redo your changes.
+# For instructions on how to add custom hooks see the comment below.
# In GitLab Enterprise Edition you can use Git Hooks instead.
# See http://doc.gitlab.com/ee/git_hooks/git_hooks.html
@@ -15,16 +14,17 @@ repo_path = Dir.pwd
require_relative '../lib/gitlab_access'
if GitlabAccess.new(repo_path, key_id, refs).exec
+ ## How to add a custom hooks to some repositories:
+ ## 1) Put a file with custom code in the repository root directory.
+ ## 2) Uncomment the lines below.
+ ## 3) Replace 'project-specific-hook' with the name if the custom file.
+ ## 4) If you upgrade GitLab Shell you will have to redo your changes.
+ #
+ # if File.exists?('project-specific-hook')
+ # execute 'project-specific-hook'
+ # end
exit 0
else
exit 1
end
-## How to add a custom hooks to some repositories:
-## 1) Put a file with custom code in the repository root directory.
-## 2) Uncomment the lines below.
-## 3) Replace 'project-specific-hook' with the name if the custom file.
-#
-# if File.exists?('project-specific-hook')
-# execute 'project-specific-hook'
-# end