-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Commit messages are not properly formatted. #13274
Comments
Could you push/reproduce on try for others to see? |
I am not sure if there is any way to fix this other than rewrapping the text before displaying it, which would be quite a complex task since you might not want some things wrapped (e.g. lists). An alternative would be to set There seems to be quite a lot of space left over, so it shouldn't be a particularly difficult thing, just a few CSS tweaks. I think I can take a look at this. |
I think this would fix it. From 13a36fa6a803ccbe6ec5aac064ebea48a0479665 Mon Sep 17 00:00:00 2001
From: Andrew Thornton <art27@cantab.net>
Date: Sun, 25 Oct 2020 20:08:38 +0000
Subject: [PATCH] Set overflow-x and white-space: pre for commit-body
Fix #13274
Signed-off-by: Andrew Thornton <art27@cantab.net>
---
web_src/less/_repository.less | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/web_src/less/_repository.less b/web_src/less/_repository.less
index e84060b06..1db010e88 100644
--- a/web_src/less/_repository.less
+++ b/web_src/less/_repository.less
@@ -3020,7 +3020,8 @@ tbody.commit-list {
}
.commit-body {
- white-space: pre-wrap;
+ white-space: pre;
+ overflow-x: scroll;
}
.git-notes {
--
2.25.1
|
Horizontally scrolling is pretty annoying, wouldn't it be better if we could show the commit message body below, like GitHub does it? This would certainly fix the issue, but it'd make it pretty annoying to read having to scroll back and forth. |
I think Github style would be better and more readable in general -- current view is already pretty cramped and I don't think horizontal scrolling in a tiny area would be good. |
@pta2002 @mrsdizzie Yeah, I think that is the responsibility of the message author to make it right. That seems to be how Git and the third-party tools should handle the commit messages too. The chances that we are going to be bothered by long lines of commit messages should be slim. @zeripath Thanks for the patch :) I'll try it out. |
Fixed by #21564? |
Gitea version (or commit ref):
commit 144fa5a
Date: Wed Oct 7 23:24:41 2020 +0100
Plus Use the headline comment of pull-request as the squash commit's message #13071. Built from source.
Git version:
git version 2.28.0
Operating system:
"18.04.5 LTS (Bionic Beaver)"
Database (use
[x]
):Can you reproduce the bug at https://try.gitea.io:
Description
The long lines in the git commit message are broken inappropriately.
Typically, I use the vim auto-wrapping feature to format the message. (type "gqip" in the normal mode)
As you can see in the screenshot, additional line breaks are inserted between the real lines.
Screenshots
The text was updated successfully, but these errors were encountered: