summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--changelogs/unreleased/fix-multi-line-hook-output.yml5
-rw-r--r--changelogs/unreleased/voogsgerd-gitlab-ce-daniel-legacy-config.yml5
-rw-r--r--config/gitlab.yml.example6
-rw-r--r--lib/gitlab/git/hook.rb7
-rw-r--r--spec/lib/gitlab/git/hook_spec.rb3
5 files changed, 16 insertions, 10 deletions
diff --git a/changelogs/unreleased/fix-multi-line-hook-output.yml b/changelogs/unreleased/fix-multi-line-hook-output.yml
new file mode 100644
index 00000000000..f625ec2ee6c
--- /dev/null
+++ b/changelogs/unreleased/fix-multi-line-hook-output.yml
@@ -0,0 +1,5 @@
+---
+title: Display full pre-receive and post-receive hook output in GitLab UI
+merge_request: 14222
+author: Robin Bobbitt
+type: fixed
diff --git a/changelogs/unreleased/voogsgerd-gitlab-ce-daniel-legacy-config.yml b/changelogs/unreleased/voogsgerd-gitlab-ce-daniel-legacy-config.yml
new file mode 100644
index 00000000000..faa5d3303c6
--- /dev/null
+++ b/changelogs/unreleased/voogsgerd-gitlab-ce-daniel-legacy-config.yml
@@ -0,0 +1,5 @@
+---
+title: Removed two legacy config options
+merge_request:
+author: Daniel Voogsgerd
+type: deprecated
diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example
index cd44f888d3f..9b496822e93 100644
--- a/config/gitlab.yml.example
+++ b/config/gitlab.yml.example
@@ -577,12 +577,6 @@ production: &base
# Use the default values unless you really know what you are doing
git:
bin_path: /usr/bin/git
- # The next value is the maximum memory size grit can use
- # Given in number of bytes per git object (e.g. a commit)
- # This value can be increased if you have very large commits
- max_size: 20971520 # 20.megabytes
- # Git timeout to read a commit, in seconds
- timeout: 10
## Webpack settings
# If enabled, this will tell rails to serve frontend assets from the webpack-dev-server running
diff --git a/lib/gitlab/git/hook.rb b/lib/gitlab/git/hook.rb
index cc35d77c6e4..208e4bbaf60 100644
--- a/lib/gitlab/git/hook.rb
+++ b/lib/gitlab/git/hook.rb
@@ -83,13 +83,14 @@ module Gitlab
def call_update_hook(gl_id, oldrev, newrev, ref)
Dir.chdir(repo_path) do
stdout, stderr, status = Open3.capture3({ 'GL_ID' => gl_id }, path, ref, oldrev, newrev)
- [status.success?, stderr.presence || stdout]
+ [status.success?, (stderr.presence || stdout).gsub(/\R/, "<br>").html_safe]
end
end
def retrieve_error_message(stderr, stdout)
- err_message = stderr.gets
- err_message.blank? ? stdout.gets : err_message
+ err_message = stderr.read
+ err_message = err_message.blank? ? stdout.read : err_message
+ err_message.gsub(/\R/, "<br>").html_safe
end
end
end
diff --git a/spec/lib/gitlab/git/hook_spec.rb b/spec/lib/gitlab/git/hook_spec.rb
index ea3e4680b1d..0ff4f3bd105 100644
--- a/spec/lib/gitlab/git/hook_spec.rb
+++ b/spec/lib/gitlab/git/hook_spec.rb
@@ -28,6 +28,7 @@ describe Gitlab::Git::Hook do
f.write(<<-HOOK)
echo 'regular message from the hook'
echo 'error message from the hook' 1>&2
+ echo 'error message from the hook line 2' 1>&2
exit 1
HOOK
end
@@ -73,7 +74,7 @@ describe Gitlab::Git::Hook do
status, errors = hook.trigger(gl_id, blank, blank, ref)
expect(status).to be false
- expect(errors).to eq("error message from the hook\n")
+ expect(errors).to eq("error message from the hook<br>error message from the hook line 2<br>")
end
end
end