Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
vettamatt opened this issue Oct 29, 2023 · 5 comments
Closed

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

vettamatt opened this issue Oct 29, 2023 · 5 comments
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail

Comments

@vettamatt
Copy link

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

@BaiZe1998
Copy link

I can't reproduce this

@JakobDev
Copy link
Contributor

Maybe you accidentality changed the EOL

@lunny lunny added issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail and removed type/bug labels Oct 30, 2023
@lunny
Copy link
Member

lunny commented 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.

@wxiaoguang
Copy link
Contributor

wxiaoguang commented 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 "

@vettamatt
Copy link
Author

vettamatt commented 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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail
Projects
None yet
Development

No branches or pull requests

5 participants