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

Commit messages are not properly formatted. #13274

Closed
1 of 5 tasks
typeless opened this issue Oct 23, 2020 · 9 comments
Closed
1 of 5 tasks

Commit messages are not properly formatted. #13274

typeless opened this issue Oct 23, 2020 · 9 comments
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented topic/ui Change the appearance of the Gitea UI

Comments

@typeless
Copy link
Contributor

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

image

@mrsdizzie
Copy link
Member

Could you push/reproduce on try for others to see?

@typeless
Copy link
Contributor Author

typeless commented Oct 24, 2020

@pta2002
Copy link
Contributor

pta2002 commented Oct 25, 2020

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 overflow-x: scroll on the CSS, which would add a scroll bar to the CSS, or maybe just make this section 80ch wide, which should fit the message.

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.

@pta2002
Copy link
Contributor

pta2002 commented Oct 25, 2020

image
could also follow GitHub's lead and show it below the other things

@zeripath
Copy link
Contributor

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

@pta2002
Copy link
Contributor

pta2002 commented Oct 25, 2020

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.

@mrsdizzie
Copy link
Member

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.

@typeless
Copy link
Contributor Author

@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.

@lafriks lafriks added the topic/ui Change the appearance of the Gitea UI label Oct 26, 2020
@stale stale bot added the issue/stale label Dec 25, 2020
@go-gitea go-gitea deleted a comment from stale bot Dec 26, 2020
@stale stale bot removed the issue/stale label Dec 26, 2020
@lunny lunny added the issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented label Dec 26, 2020
@yardenshoham
Copy link
Member

Fixed by #21564?

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented topic/ui Change the appearance of the Gitea UI
Projects
None yet
Development

No branches or pull requests

8 participants