Web GUI commit diff shows large change for a single line change #11931

Closed
opened 2025-11-02 09:52:06 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @vettamatt on GitHub (Oct 29, 2023).

Description

When doing a commit from web UI, diff shows large change for a single line change, in files too large for the editor.

To reproduce, using the web GUI at try.gitea.io:

  • Make a repo, initialise the repo, and commit a new text file with lots of text, definitely over 1000 lines.
  • Make a new branch, edit the text file, add a single line amongst the other lines.
  • Commit
  • View the commit you just completed, you'll see the problem. My normal expectation is that the commit should reference up to 5 lines either side and should only modify one line (because that is what you did above), but instead, you'll see many lines also being modified, although they weren't changed.

https://try.gitea.io/vettatest2/test1/commit/fcf0c440d3fe1aad64e8884fec5d24f462cedc1a

Gitea Version

1.22.0+dev-256-gb36e2ca41

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

Too large to show in a screenshot

Git Version

Whichever try.gitea.io is running

Operating System

Whichever try.gitea.io is running

How are you running Gitea?

We run Gitea with Docker, but for this bug, it's fully reproducable in try.gitea.io.

Database

MySQL/MariaDB

Originally created by @vettamatt on GitHub (Oct 29, 2023). ### Description When doing a commit from web UI, diff shows large change for a single line change, in files too large for the editor. To reproduce, using the web GUI at try.gitea.io: - Make a repo, initialise the repo, and commit a new text file with lots of text, definitely over 1000 lines. - Make a new branch, edit the text file, add a single line amongst the other lines. - Commit - View the commit you just completed, you'll see the problem. My normal expectation is that the commit should reference up to 5 lines either side and should only modify one line (because that is what you did above), but instead, you'll see many lines also being modified, although they weren't changed. <https://try.gitea.io/vettatest2/test1/commit/fcf0c440d3fe1aad64e8884fec5d24f462cedc1a> ### Gitea Version 1.22.0+dev-256-gb36e2ca41 ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist _No response_ ### Screenshots Too large to show in a screenshot ### Git Version Whichever try.gitea.io is running ### Operating System Whichever try.gitea.io is running ### How are you running Gitea? We run Gitea with Docker, but for this bug, it's fully reproducable in try.gitea.io. ### Database MySQL/MariaDB
GiteaMirror added the issue/needs-feedback label 2025-11-02 09:52:06 -06:00
Author
Owner

@BaiZe1998 commented on GitHub (Oct 30, 2023):

I can't reproduce this

@BaiZe1998 commented on GitHub (Oct 30, 2023): I can't reproduce this
Author
Owner

@JakobDev commented on GitHub (Oct 30, 2023):

Maybe you accidentality changed the EOL

@JakobDev commented on GitHub (Oct 30, 2023): Maybe you accidentality changed the EOL
Author
Owner

@lunny commented on GitHub (Oct 30, 2023):

It's obvoius from your try site link. Before all content are in one line, after those content is splitted as multiple lines.

@lunny commented on GitHub (Oct 30, 2023): It's obvoius from your try site link. Before all content are in one line, after those content is splitted as multiple lines.
Author
Owner

@wxiaoguang commented on GitHub (Oct 30, 2023):

That's the HTML standard. All lines in textarea end with "\r\n", and Gitea ever did some tricks. Such behavior should have been fixed by " Fix EOL handling in web editor #27141 "

@wxiaoguang commented on GitHub (Oct 30, 2023): That's the HTML standard. All lines in textarea end with "\r\n", and Gitea ever did some tricks. Such behavior should have been fixed by " Fix EOL handling in web editor #27141 "
Author
Owner

@vettamatt commented on GitHub (Oct 30, 2023):

@lunny Looking at a diff of the commit at my try site link, they look like they were individual lines before and after, unsure what you're meaning here. Unless maybe my text editor is fixing the newline characters.
Good to hear it was fixed in #27141.
I'm unable to reproduce today, closing this issue.

@vettamatt commented on GitHub (Oct 30, 2023): @lunny Looking at a diff of the commit at my try site link, they look like they were individual lines before and after, unsure what you're meaning here. Unless maybe my text editor is fixing the newline characters. Good to hear it was fixed in [#27141](https://github.com/go-gitea/gitea/pull/27141). I'm unable to reproduce today, closing this issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#11931