[go: up one dir, main page]

Skip to content

Syntax highlight in MR and commit pages not respected if custom setting gitlab-language in gitattributes

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Summary

GitLab Enterprise Edition v17.8.1-ee

Syntax highlight in MR and commit pages not respected if custom setting gitlab-language in gitattributes

Steps to reproduce

For example, in default branch of project make this .gitattributes:

*.cls eol=lf gitlab-language=cos
*.mac eol=lf gitlab-language=cos

If we open .../-/blob/ba67506332f55be62fb21b05fa4834facbddf647/Code/testCode.mac then code have syntax highlight as on screenshot (it is good):

Click to expand image

Example Project

What is the current bug behavior?

If we open .../-/commit/d5101e6f9e9fc8f35ad4ceab748b1cce275b3614 then highlight syntax disappeared:

Click to expand image
There is the same problem in MR diffs.

What is the expected correct behavior?

Syntax highlighting on commit pages and on MR diffs respects settings in .gitattributes

Relevant logs and/or screenshots

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info

(For installations with omnibus-gitlab package run and paste the output of:
`sudo gitlab-rake gitlab:env:info`)

(For installations from source run and paste the output of:
`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:check SANITIZE=true)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)

(we will only investigate if the tests are passing)

Possible fixes

Describe what you would like to see improved.

Edited by 🤖 GitLab Bot 🤖