Diff display suppression should not trigger on long lines #753

Closed
opened 2025-11-02 03:35:11 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @silverwind on GitHub (May 28, 2017).

Description

Diff with long lines is errounously detected a being "too large", e.g. should only trigger on char count:

Actual diff ist just 2 (long) lines:

diff --git a/nginx.conf b/nginx.conf
index 568178d..8890cd3 100644
--- a/nginx.conf
+++ b/nginx.conf
@@ -1,2 +1,2 @@
-ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256';
-# ssl_ciphers "ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS";
+# ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256';
+ssl_ciphers "ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS";
Originally created by @silverwind on GitHub (May 28, 2017). - Gitea version (or commit ref): e67ece2 - Can you reproduce the bug at https://try.gitea.io: - [x] Yes - https://try.gitea.io/silverwind/symlink-test/commit/f2f2a03c79d7b2ab89785fca78c2f85d123b7d78 ## Description Diff with long lines is errounously detected a being "too large", e.g. should only trigger on char count: <img width="600" src="https://cloud.githubusercontent.com/assets/115237/26527925/79b55402-439e-11e7-989c-ac63119672ab.png"> Actual diff ist just 2 (long) lines: ````diff diff --git a/nginx.conf b/nginx.conf index 568178d..8890cd3 100644 --- a/nginx.conf +++ b/nginx.conf @@ -1,2 +1,2 @@ -ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256'; -# ssl_ciphers "ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS"; +# ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256'; +ssl_ciphers "ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS"; ````
GiteaMirror added the type/enhancement label 2025-11-02 03:35:11 -06:00
Author
Owner

@andreynering commented on GitHub (May 28, 2017):

Diff with long lines is errounously detected a being "too large".

It's not errounosly, it's by design. The issue is that lives with many chars make the browser slow or even hang.

An example of this is a minified JS or CSS. It's often a single line, and your browser will hang.

You can change that in your app.ini. We can maybe discuss change the default value.

@andreynering commented on GitHub (May 28, 2017): > Diff with long lines is errounously detected a being "too large". It's not errounosly, it's by design. The issue is that lives with many chars make the browser slow or even hang. An example of this is a minified JS or CSS. It's often a single line, and your browser will hang. You can change that in your `app.ini`. We can maybe discuss change the default value.
Author
Owner

@silverwind commented on GitHub (May 28, 2017):

Right, my example is 681 characters, while the default limit is 500 chars on a single line. I'd say a value like 2000 or more would be a more reasonable default (Quite hard to find a minfied script that is not at least that length).

@silverwind commented on GitHub (May 28, 2017): Right, my example is 681 characters, while the default limit is 500 chars on a single line. I'd say a value like 2000 or more would be a more reasonable default (Quite hard to find a minfied script that is not at least that length).
Author
Owner

@andreynering commented on GitHub (May 29, 2017):

I'm ok with 2000 if that don't make the browser slow, but maybe 1000 is
enough to cover most cases.

That said, a PR with the change would be welcome.

Em dom, 28 de mai de 2017 11:10, silverwind notifications@github.com
escreveu:

Right, my example is 681 characters, while the default limit is 500 chars
on a single line. I'd say a value like 2000 or more would be a more
reasonable default (Quite hard to find a minfied script that is not at
least that length).


You are receiving this because you commented.

Reply to this email directly, view it on GitHub
https://github.com/go-gitea/gitea/issues/1826#issuecomment-304517590,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AGr96z7vZuI-yZ2kWc7o8X_40Oe0GN8Pks5r-YBigaJpZM4NomzQ
.

@andreynering commented on GitHub (May 29, 2017): I'm ok with 2000 if that don't make the browser slow, but maybe 1000 is enough to cover most cases. That said, a PR with the change would be welcome. Em dom, 28 de mai de 2017 11:10, silverwind <notifications@github.com> escreveu: > Right, my example is 681 characters, while the default limit is 500 chars > on a single line. I'd say a value like 2000 or more would be a more > reasonable default (Quite hard to find a minfied script that is not at > least that length). > > — > You are receiving this because you commented. > > > Reply to this email directly, view it on GitHub > <https://github.com/go-gitea/gitea/issues/1826#issuecomment-304517590>, > or mute the thread > <https://github.com/notifications/unsubscribe-auth/AGr96z7vZuI-yZ2kWc7o8X_40Oe0GN8Pks5r-YBigaJpZM4NomzQ> > . >
Author
Owner

@silverwind commented on GitHub (May 29, 2017):

Line length alone isn't what makes browsers slow. Slowness is from my oberservation based purely on total character amount, or more specifically, the amount of DOM nodes rendered.

I'm leaning towards increasing it even more, maybe 5k. That's what I currently use in my Gitea instance.

@silverwind commented on GitHub (May 29, 2017): Line length alone isn't what makes browsers slow. Slowness is from my oberservation based purely on total character amount, or more specifically, the amount of DOM nodes rendered. I'm leaning towards increasing it even more, maybe 5k. That's what I currently use in my Gitea instance.
Author
Owner

@DblK commented on GitHub (May 29, 2017):

I think it's linked to #1827

@DblK commented on GitHub (May 29, 2017): I think it's linked to #1827
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#753