[go: up one dir, main page]

Skip to content

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 warningScreenshot 2024-11-29 at 3.36.52 PM.png

  • MR "Changes" View file with newline at end of file ➜ Does not display the newline

    Screenshot 2024-11-29 at 3.39.35 PM.png

  • File view file with newline at end of file ➜ Displays newline

    Screenshot 2024-11-29 at 3.40.52 PM.png

  • Raw view file with newline at end of file ➜ doesn't include the newline in raw

    Screenshot 2024-11-29 at 3.52.39 PM.png

  • Raw file download maintains the newline at the end of file

Steps to reproduce

  1. Commit and push file with a trailing new line
  2. Go into web interface, observe how the newline is displayed in diffs, file view and raw mode

Example Project

https://gitlab.com/kicad/code/kicad/-/blob/a8bd0a9b84156a10c647c47cbbdb30f748eb0a2b/resources/msw/kiwin32.rc

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

Edited by 🤖 GitLab Bot 🤖