Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9782

Preserve leading whitespaces in commit message bodies (GitLab)

$
0
0

(see also the same issue in Redmine)

git log correctly displays indentation and alignment created by inserting leading whitespaces:

Do some cool stuffclass CoolStuffCapable+ function doSomeCoolStuff does cool stuff  ? beware of uncool limitations I need to fix later    ? soonGettingSolved will be fixed within the current major release    ? longLongWithUs will remain until at least the next major release  ? there is a precondition I cannot get rid of? moved field BoringStuffCapable::notSoInternalState to fix Feature Envy  ? renamed to reallyInternalState accordingly- constant MAYBE_UNUSED was unusedrefs #1

gitlab-ce:16.3.4-ce.0 trims these whitespaces, even though it puts commit messages into <pre> tags that would support leading whitespaces:

Do some cool stuffclass CoolStuffCapable+ function doSomeCoolStuff does cool stuff? beware of uncool limitations I need to fix later? soonGettingSolved will be fixed within the current major release? longLongWithUs will remain until at least the next major release? there is a precondition I cannot get rid of? moved field BoringStuffCapable::notSoInternalState to fix Feature Envy? renamed to reallyInternalState accordingly- constant MAYBE_UNUSED was unusedrefs #1

Notably, it does this only within Merge requests - when viewing individual commits, it displays the leading whitespaces correctly.

That is:

  • <GitLab url>/<Project>/-/commit/<hash> displays fine
  • <GitLab url>/<Project>/-/merge_requests/<request Id>/diffs?commit_id=<hash> omits trailing whitespaces

Can I make it display the correct message everywhere?

(The given version is the minimal version I can use. Updating to a later version is fine.)


Viewing all articles
Browse latest Browse all 9782

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>