Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 6.3k
Improve and unify commit author rendering#36094
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
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading. Please reload this page.
Conversation
lafriks commented Dec 5, 2025
I don't think showing email in the UI is a good idea, maybe only for authorized users |
silverwind commented Dec 5, 2025
It was already shown previously as a tooltip on the avatar in the commit view, but was not consistent. |
silverwind commented Dec 5, 2025
And yes, I agree it should be hidden for anonymous users, but imho thats a separate topic and we need to validate all places where we pass these addresses to the frontend. |
silverwind commented Dec 5, 2025 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
I think I could actually try to fix this at least in these 3 places, make a subtemplate for "avatar and username" and do the logged in check there, wip until then. |
lunny commented Dec 5, 2025
Since the repository is public, it can be accessed freely. Anyone can clone it and obtain the email information locally anyway. |
silverwind commented Dec 5, 2025
I guess it has a small benefit against scrape bots. |
lafriks commented Dec 6, 2025
Yes, GitHub also does not show emails in git for the very same reason most probably |
silverwind commented Dec 10, 2025
This proves harder than I thought because these templates are such a mess, there is |
silverwind commented Dec 11, 2025 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
Shared template added but there is a unresolved issue on latest commit page and commit view:
|
silverwind commented Dec 11, 2025
Fixed above by not passing these invalid The E-Mail adress is also no longer rendered into HTML for signed-out users. |
| @@ -0,0 +1,56 @@ | |||
| {{/* TemplateAttributes: | |||
| * User: Theuserassociatedwiththecommit, ifany | |||
| * Commit: Thecommit | |||
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.
I don't think you should pass so many different structs.
Commit is not really used. What you need is a "git user" or "gitea user".
silverwindDec 11, 2025 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
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.
Commit is used for .Commit.Author vs .Author. Maybe it can be unified, not sure. The three pages all pass different context variables.
| {{ifand.User.FullNameDefaultShowFullName}} | ||
| {{$username = .User.FullName}} | ||
| {{elseif .User.Name}} | ||
| {{$username = .User.Name}} | ||
| {{end}} |
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.
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.
I wonder if *User will also be compatible with .Author.
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.
I wonder if
*Userwill also be compatible with.Author.
No. More complicated.
Uh oh!
There was an error while loading. Please reload this page.
| {{else}} | ||
| {{.Author.Name}} | ||
| {{end}} | ||
| </span> |
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.
silverwindDec 13, 2025 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
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.
I don't have a full picture what the 3 variants of data being passed into here are. Deeper analysis will be needed to determine if any of this can be reduced. All your remaining comments are about this same topic. If you have a better picture of the data passed in, feel free to change it yourself.
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.
Sorry, I don't have a full picture at the moment either. The details I know were written in #24087 (comment) (commit is not really related).
I think I don't have time or motivation to do it at the moment.
If you'd like to use the "shared templates", I think you need to make it clear and maintainable, but not leave the problem to the future maintainers ....



Uh oh!
There was an error while loading. Please reload this page.