Push Options don't allow newlines in values

Problem to solve

When creating a Merge Request with the Push Options feature, I can't create a description that contains newlines.

Example:

$ git push -o merge_request.create -o merge_request.title="Do something" -o merge_request.description='
# Summary
Do something.

# Testing
Deploy this on your box. Then test it.
'

> fatal: push options must not have new line characters

Git does not allow newlines in push options. When I try to emulate them via "\n", they get copied verbatim, and my MR looks like this:

Summary\nDo something.\n# Testing\nDeploy this on your box.\n\nThen test it.

The \n's are pasted verbatim, everything is parsed as a single line.

Intended users

  • Sasha (Software Developer)

    • Sasha might want to create a script to quickly create merge requests from their local box, maybe using a description previously drafted in a text file.
  • Devon (DevOps Engineer)

    • Devon might want to create automated merge-requests to alert developers about release branches not being in sync, and requesting them to fix merge conflicts.

User experience goal

The user should be able to create merge requests containing a multiline description via push options.

Proposal

When parsing push options, replace "\n" by newlines, so that users can create multiline descriptions.

Documentation

Update https://docs.gitlab.com/ee/user/project/push_options.html with the possibility to add newlines

Edited by Claus Strasburger