-
-
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
Use only first line of commit when creating referenced comment #11960
Conversation
The alternative here is to write a migration that extracts actual content from anchor link in database and save it without it, then we render it as we do other commits with ellipsis |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would say this is a bugfix witch we can backport to v1.12.1
@CirnoT beside this you could refactor it for v1.13 in a new pull :) |
@6543 If we do backport, we backport is instead of this PR, otherwise we'll lose additional data for new commits. |
Alternatively, we could merge this for v1.12.1 backport and refactor to store only commit hash in database and fetch commit message on-the-fly for v1.13. |
I would display the first line and make a a "> more" in the next line |
We do support a |
Think it would look bad and be clunky to have any kind of expanding 'read more' button. Thats why it already links to the commit page : ) |
@zeripath whats the point for SplitN since the rest will be cut away in all cases? - does it use less memory? |
good point - so i think we dont need any refactor just display only the first line |
Definitely should, let me take a quick look |
@6543 what's the point of reading the rest of the string splitting it in to every line when you don't care about the other lines? SplitN reads until it has the requested number of splits and stops. Split reads the entire string. |
Should be fixed on feeds now too |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Frontpage working, thanks!
…tea#11960) * Use only first line of commit when creating referenced comment * Update modules/repofiles/action.go * Display first line only on feeds too Co-authored-by: techknowlogick <[email protected]> Co-authored-by: zeripath <[email protected]>
We should only include first line. Ideally we'd use some form of ellipsis but that would require some heavy refactoring, as right now we store anchor HTML in database.
Before:
After: