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

Show latest commit for file #28067

Merged
merged 11 commits into from
Jan 15, 2024
Merged

Show latest commit for file #28067

merged 11 commits into from
Jan 15, 2024

Conversation

JakobDev
Copy link
Contributor

If you view a file, you can now see the latest commit that changed that file.

grafik

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Nov 15, 2023
@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 15, 2023
@lunny lunny added the topic/ui Change the appearance of the Gitea UI label Nov 15, 2023
@lunny
Copy link
Member

lunny commented Nov 15, 2023

The space between commit rows and code top bar should be bigger.

@JakobDev
Copy link
Contributor Author

Should we not attach the box, the keep it in sync with the file list?

grafik

@lunny
Copy link
Member

lunny commented Nov 15, 2023

This is how GH did that.

image

@JakobDev
Copy link
Contributor Author

I know how it looks in GitHub. GitHub uses the same design for a single file and a list of files. We have in Gitea on the file list currently a other design than GitHub, so I the 2 designs should match.

@yp05327
Copy link
Contributor

yp05327 commented Nov 16, 2023

Maybe we can move the History button to the same place?
image
image

@JakobDev
Copy link
Contributor Author

Maybe we can move the History button to the same place?

I also thought about this, But I thin this should be part of another PR

@delvh delvh added the type/feature Completely new functionality. Can only be merged if feature freeze is not active. label Dec 30, 2023
@@ -333,6 +333,35 @@ func renderReadmeFile(ctx *context.Context, subfolder string, readmeFile *git.Tr
}
}

func loadLatestCommitData(ctx *context.Context, latestCommit *git.Commit) bool {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is routers the correct place for this function?
I don't think so, services is probably better.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This codes mostly sets ctx.Data, so it belongs here. It was also the whole time in this file.

templates/repo/view_file.tmpl Outdated Show resolved Hide resolved
templates/repo/latest_commit.tmpl Outdated Show resolved Hide resolved
commit, err := ctx.Repo.Commit.GetCommitByPath(util.PathEscapeSegments(ctx.Repo.TreePath))
commit, err := ctx.Repo.Commit.GetCommitByPath(ctx.Repo.TreePath)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This caused an error on non ASCII paths.

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Dec 30, 2023
@denyskon denyskon added the giteabot/update-branch Hint for the bot that it should update a PR with the latest state on main label Jan 14, 2024
@GiteaBot GiteaBot removed the giteabot/update-branch Hint for the bot that it should update a PR with the latest state on main label Jan 14, 2024
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jan 14, 2024
@denyskon denyskon added this to the 1.22.0 milestone Jan 14, 2024
@lunny
Copy link
Member

lunny commented Jan 15, 2024

Please resolve the conflicts.

@delvh delvh added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Jan 15, 2024
@lunny
Copy link
Member

lunny commented Jan 15, 2024

图片

@delvh delvh removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Jan 15, 2024
@lunny
Copy link
Member

lunny commented Jan 15, 2024

Render failed, failed to render template: repo/home, error: template error: builtin(static):repo/latest_commit:25:101 : executing "repo/latest_commit" at <RenderCommitMessageLinkSubject>: wrong number of args for RenderCommitMessageLinkSubject: want 4 got 5
----------------------------------------------------------------------
	<span class="grey commit-summary" title="{{.LatestCommit.Summary}}"><span class="message-wrapper">{{RenderCommitMessageLinkSubject $.Context .LatestCommit.Message $.RepoLink $commitLink ($.Repository.ComposeMetas ctx)}}</span>
	                                                                                                    ^
----------------------------------------------------------------------

@JakobDev
Copy link
Contributor Author

Everything is now working again

@denyskon denyskon added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Jan 15, 2024
@delvh delvh merged commit 885cc32 into go-gitea:main Jan 15, 2024
25 checks passed
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Jan 15, 2024
@JakobDev JakobDev deleted the filecommit branch January 15, 2024 17:07
zjjhot added a commit to zjjhot/gitea that referenced this pull request Jan 16, 2024
* giteaofficial/main: (34 commits)
  Use refname:strip-2 instead of refname:short when syncing tags (go-gitea#28797)
  Add gist to comparison (go-gitea#28809)
  Fix links in issue card (go-gitea#28806)
  Show latest commit for file (go-gitea#28067)
  Add ability to see open and closed issues at the same time (go-gitea#28757)
  Display latest sync time for pull mirrors on the repo page (go-gitea#28712)
  Fix `GetCommitStatuses` (go-gitea#28787)
  Caller should check the ResponseExtra.HasError() first to see whether the request fails (go-gitea#28796)
  Rework markup link rendering (go-gitea#26745)
  Fix nil pointer panic when exec some gitea cli command (go-gitea#28791)
  Add branch protection setting for ignoring stale approvals (go-gitea#28498)
  Forbid removing the last admin user (go-gitea#28337)
  Fix when private user following user, private user will not be counted in his own view (go-gitea#28037)
  Update github.com/cloudflare/circl (go-gitea#28789)
  Move more functions to db.Find (go-gitea#28419)
  Add non-JS fallback for reaction tooltips (go-gitea#28785)
  Modernize merge button (go-gitea#28140)
  Warn that `DISABLE_QUERY_AUTH_TOKEN` is false only if it's explicitly defined (go-gitea#28783)
  Speed up loading the dashboard on mysql/mariadb (go-gitea#28546)
  Fix schedule tasks bugs (go-gitea#28691)
  ...
fuxiaohei pushed a commit to fuxiaohei/gitea that referenced this pull request Jan 17, 2024
If you view a file, you can now see the latest commit that changed that file.

![grafik](https://github.com/go-gitea/gitea/assets/15185051/272c3120-6db7-4f88-86e1-60080c9aabe5)

---------

Co-authored-by: Denys Konovalov <[email protected]>
henrygoodman pushed a commit to henrygoodman/gitea that referenced this pull request Jan 31, 2024
If you view a file, you can now see the latest commit that changed that file.

![grafik](https://github.com/go-gitea/gitea/assets/15185051/272c3120-6db7-4f88-86e1-60080c9aabe5)

---------

Co-authored-by: Denys Konovalov <[email protected]>
silverwind pushed a commit to silverwind/gitea that referenced this pull request Feb 20, 2024
If you view a file, you can now see the latest commit that changed that file.

![grafik](https://github.com/go-gitea/gitea/assets/15185051/272c3120-6db7-4f88-86e1-60080c9aabe5)

---------

Co-authored-by: Denys Konovalov <[email protected]>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. topic/ui Change the appearance of the Gitea UI type/feature Completely new functionality. Can only be merged if feature freeze is not active.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants