Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Issues
  • #3982

Closed
Open
Created May 17, 2013 by Administrator@rootOwner

Webbased editor changes all end-of-line markers.

Created by: nielsbasjes

Summary: Editing a file using the webbased editor changes the line endings to what the browser uses.

Steps to reproduce: I create a text file (i.e. some sourcecode using vim) under Linux and commit and push it to a git repo under gitlab. Then I see a small typo and edit the file using the webbased editor from my Chrome under Windows 7. After I commit the changed file it turns out that ALL lines of the file have been changed because the "UNIX" end-of-line has been replaced with the "Windows" end-of-line.

Expected behavior: The line endings of the untouched lines remain unchanged. I'm unsure what the behaviour of changed and new lines should be.

Observed behavior: ALL line endings have changed into "Windows style" when editing under windows.

Relevant logs and/or screen shots: When I look in the change set of a commit did as a test (I changed nothing, I just did a commit from the webeditor) on a file with 7 lines: "Showing 0 changed files" and "This commit has 7 additions and 7 deletions"

Output of checks Results of GitLab Application Check (sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production); we will only investigate if the tests are passing

All tests are passing. Only a single unimportant notice about the init.d script not being up to date.

Version of GitLab you are running; 5.2.0 02a7b127 Describe your setup (use relevant parts from sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production) CentOS 6.4, Git 1.8.3.1

Possible fixes: Have a setting next to the "Save" button of the webeditor that specifies the desired line endings (Unix/Dos/Mac/...), then at save of the webeditor forces this on the entire file. The setting should default to the line ending type that occurs most in the given file.

Assignee
Assign to
Time tracking