summaryrefslogtreecommitdiff
path: root/hooks
diff options
context:
space:
mode:
authorSytse Sijbrandij <sytses@gmail.com>2014-10-29 15:28:04 -0700
committerSytse Sijbrandij <sytses@gmail.com>2014-10-29 15:28:04 -0700
commit44601bac008b61412b638236d59d18b1bcbddd65 (patch)
tree51edbb227fa3b333b7bb3c87a4781f0dbb1a0d12 /hooks
parentcc193ea45d8d0651fe09fc93bb1417eaac50c2ff (diff)
downloadgitlab-shell-44601bac008b61412b638236d59d18b1bcbddd65.tar.gz
Better comments in the git hooks and give workaround.
Diffstat (limited to 'hooks')
-rwxr-xr-xhooks/post-receive21
-rwxr-xr-xhooks/pre-receive19
2 files changed, 34 insertions, 6 deletions
diff --git a/hooks/post-receive b/hooks/post-receive
index d85ad42..befe213 100755
--- a/hooks/post-receive
+++ b/hooks/post-receive
@@ -1,8 +1,14 @@
#!/usr/bin/env ruby
-# This file was placed here by GitLab. It makes sure that your pushed commits
-# will be processed properly.
-# You can add your own hooks to this file, but be careful when updating gitlab-shell!
+# 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.
+# 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
+# See http://doc.gitlab.com/ce/web_hooks/web_hooks.html
changes = ARGF.read
key_id = ENV['GL_ID']
@@ -15,3 +21,12 @@ if GitlabPostReceive.new(repo_path, key_id, changes).exec
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 2b979fa..fe4ea4c 100755
--- a/hooks/pre-receive
+++ b/hooks/pre-receive
@@ -1,8 +1,12 @@
#!/usr/bin/env ruby
-# This file was placed here by GitLab. It makes sure that your pushed commits
-# will be processed properly.
-# You can add your own hooks to this file, but be careful when updating gitlab-shell!
+# 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.
+# In GitLab Enterprise Edition you can use Git Hooks instead.
+# See http://doc.gitlab.com/ee/git_hooks/git_hooks.html
refs = ARGF.read
key_id = ENV['GL_ID']
@@ -15,3 +19,12 @@ if GitlabAccess.new(repo_path, key_id, refs).exec
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