Gitlab web interface not displaying newline at the end of file consistently
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Summary
GitLab does not display newlines at the end of files consistently across different views, and it is unintuitive to the user whether or not the newline exists or not. This causes confusion and can be frustrating for those working in Windows Resource files for example, which are used for C++ projects, and they mandate the trailing new line or else the compiler fails.
Current Behaviour
-
MR "Changes" View file without newline at end of file ➜ Displays
\ No newline at end of file
warning -
MR "Changes" View file with newline at end of file ➜ Does not display the newline
-
File view file with newline at end of file ➜ Displays newline
-
Raw view file with newline at end of file ➜ doesn't include the newline in raw
-
Raw file download maintains the newline at the end of file
Steps to reproduce
- Commit and push file with a trailing new line
- Go into web interface, observe how the newline is displayed in diffs, file view and raw mode
Example Project
What is the current bug behavior?
This is not a bug behaviour - it is just not intuitive in design
What is the desired behavior?
New line is displayed in all modes
Output of checks
New line is displayed in all views including MR changes, File, and Raw view