Push option warnings and broadcast messages with newlines aren't formatted perfectly
The output of this test https://gitlab.com/gitlab-org/gitaly/blob/1ca4dd2/ruby/gitlab-shell/spec/gitlab_post_receive_spec.rb#L111 looks like:
========================================================================
WARNINGS:
My warning message
========================================================================
We assume that broadcast messages never have newlines (or HTML, by the way, but I think Gitaly should be receiving sanitized content):
In terminal:
remote:
remote: ========================================================================
remote:
remote: hey there<br />
remote: you're an all-star
remote:
remote: ========================================================================
So I guess real warnings look like (note that the "WARNINGS:" header gets pushed more to the left, the more warnings there are):
remote: ========================================================================
remote:
remote: WARNINGS:
remote: User is required
remote:
remote: Merge requests are not enabled for project foo/bar
remote:
remote: ========================================================================
Not the worst thing, but not ideal or expected.
-
Split on newlines and center each line in https://gitlab.com/gitlab-org/gitaly/blob/1ca4dd2/ruby/gitlab-shell/lib/gitlab_post_receive.rb#L68
Edited by Michael Kozono