[packages/gitlab-shell] patch to allow disabling hooks setup
glen
glen at pld-linux.org
Sun Dec 11 15:47:37 CET 2016
commit b532114f5ae75148aa52d038ae05147f756d67fa
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Tue Dec 6 09:44:30 2016 +0200
patch to allow disabling hooks setup
gitlab-shell.spec | 8 +++++---
skip_hooks_setup.patch | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 59 insertions(+), 3 deletions(-)
---
diff --git a/gitlab-shell.spec b/gitlab-shell.spec
index 0869983..bc9ed20 100644
--- a/gitlab-shell.spec
+++ b/gitlab-shell.spec
@@ -6,8 +6,9 @@ License: MIT
Group: Applications/Shells
Source0: https://gitlab.com/gitlab-org/gitlab-shell/repository/archive.tar.bz2?ref=v%{version}&/%{name}-%{version}.tar.bz2
# Source0-md5: 54a8a5374007277982dea2f9f07a99d1
-Patch0: config.yml.patch
-Patch1: unvendor-redis.patch
+Patch0: unvendor-redis.patch
+Patch1: skip_hooks_setup.patch
+Patch2: config.yml.patch
URL: https://gitlab.com/gitlab-org/gitlab-shell
BuildRequires: rpm-rubyprov
BuildRequires: rpmbuild(macros) >= 1.665
@@ -30,9 +31,10 @@ a replacement for Bash or Zsh.
%prep
%setup -qc
mv %{name}-*/* .
-cp -p config.yml.example config.yml
%patch0 -p1
%patch1 -p1
+cp -p config.yml.example config.yml
+%patch2 -p1
%{__sed} -i -e '1 s,#!.*ruby,#!%{__ruby},' bin/* hooks/*
diff --git a/skip_hooks_setup.patch b/skip_hooks_setup.patch
new file mode 100644
index 0000000..60f4bb1
--- /dev/null
+++ b/skip_hooks_setup.patch
@@ -0,0 +1,54 @@
+commit 9ad4db607e008110de4cfb6b6d971d0e8b53edac
+Author: Elan Ruusamäe <glen at delfi.ee>
+Date: Tue Dec 6 09:43:09 2016 +0200
+
+ add a way to disable hooks setup
+
+ really useful when migrating slowly to gitlab without affecting existing
+ repositories
+
+diff --git a/config.yml.example b/config.yml.example
+index 0164830..de52a31 100644
+--- a/config.yml.example
++++ b/config.yml.example
+@@ -69,6 +69,10 @@ audit_usernames: false
+ # For CentOS: sudo yum install epel-release && sudo yum install git-annex
+ git_annex_enabled: false
+
++# disable hooks setup in git repos
++# useful when migrating
++hooks_setup_disabled: false
++
+ # Git trace log file.
+ # If set, git commands receive GIT_TRACE* environment variables
+ # See https://git-scm.com/book/es/v2/Git-Internals-Environment-Variables#Debugging for documentation
+diff --git a/lib/gitlab_config.rb b/lib/gitlab_config.rb
+index f8a10cf..3714d8c 100644
+--- a/lib/gitlab_config.rb
++++ b/lib/gitlab_config.rb
+@@ -51,6 +51,10 @@ class GitlabConfig
+ @config['git_annex_enabled'] ||= false
+ end
+
++ def hooks_setup_disabled?
++ @config['hooks_setup_disabled'] ||= false
++ end
++
+ def git_trace_log_file
+ @config['git_trace_log_file']
+ end
+diff --git a/lib/gitlab_projects.rb b/lib/gitlab_projects.rb
+index 505b49e..e8ad797 100644
+--- a/lib/gitlab_projects.rb
++++ b/lib/gitlab_projects.rb
+@@ -23,6 +23,10 @@ class GitlabProjects
+ attr_reader :full_path
+
+ def self.create_hooks(path)
++ config = GitlabConfig.new
++ # local administrator might have disabled hooks setup
++ return true if config.hooks_setup_disabled?
++
+ local_hooks_directory = File.join(path, 'hooks')
+ real_local_hooks_directory = :not_found
+ begin
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/gitlab-shell.git/commitdiff/b532114f5ae75148aa52d038ae05147f756d67fa
More information about the pld-cvs-commit
mailing list