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

Slightly simplify LastCommitCache #20444

Merged
merged 10 commits into from
Jul 25, 2022

Conversation

zeripath
Copy link
Contributor

The LastCommitCache code is a little complex and there is unnecessary
duplication between the gogit and nogogit variants.

This PR adds the LastCommitCache as a field to the git.Repository and
pre-creates it in the ReferencesGit helpers etc. There has been some
simplification and unification of the variant code.

Signed-off-by: Andrew Thornton art27@cantab.net

The LastCommitCache code is a little complex and there is unnecessary
duplication between the gogit and nogogit variants.

This PR adds the LastCommitCache as a field to the git.Repository and
pre-creates it in the ReferencesGit helpers etc. There has been some
simplification and unification of the variant code.

Signed-off-by: Andrew Thornton <art27@cantab.net>
@zeripath zeripath added the type/refactoring Existing code has been cleaned up. There should be no new functionality. label Jul 21, 2022
@zeripath zeripath added this to the 1.18.0 milestone Jul 21, 2022
@codecov-commenter
Copy link

codecov-commenter commented Jul 22, 2022

Codecov Report

❗ No coverage uploaded for pull request base (main@9cf0352). Click here to learn what that means.
The diff coverage is 57.79%.

@@           Coverage Diff           @@
##             main   #20444   +/-   ##
=======================================
  Coverage        ?   46.88%           
=======================================
  Files           ?      977           
  Lines           ?   135250           
  Branches        ?        0           
=======================================
  Hits            ?    63408           
  Misses          ?    64064           
  Partials        ?     7778           
Impacted Files Coverage Δ
modules/git/commit.go 57.14% <0.00%> (ø)
routers/web/web.go 86.50% <0.00%> (ø)
modules/git/last_commit_cache_nogogit.go 12.50% <33.33%> (ø)
modules/git/log_name_status.go 60.51% <33.33%> (ø)
modules/git/last_commit_cache.go 58.06% <53.57%> (ø)
routers/api/v1/utils/git.go 55.31% <56.25%> (ø)
services/repository/cache.go 40.90% <57.14%> (ø)
modules/context/repo.go 51.79% <100.00%> (ø)
modules/git/commit_info_nogogit.go 58.33% <100.00%> (ø)
modules/git/notes_nogogit.go 63.07% <100.00%> (ø)
... and 4 more

Help us with your feedback. Take ten seconds to tell us how you rate us.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jul 22, 2022
modules/git/last_commit_cache.go Outdated Show resolved Hide resolved
modules/git/last_commit_cache.go Show resolved Hide resolved
@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 Jul 23, 2022
Signed-off-by: Andrew Thornton <art27@cantab.net>
@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 Jul 24, 2022
@zeripath
Copy link
Contributor Author

make lgtm work

@zeripath zeripath merged commit a2cfcdb into go-gitea:main Jul 25, 2022
@zeripath zeripath deleted the restructure-last-commit-cache branch July 25, 2022 15:39
zjjhot added a commit to zjjhot/gitea that referenced this pull request Jul 27, 2022
* giteaofficial/main:
  Hide internal package versions (go-gitea#20492)
  Fix org members bug (go-gitea#20489)
  Add labels to two buttons that were missing them (go-gitea#20419)
  fix enabling repo packages when projects are off (go-gitea#20486)
  Display project in issue list (go-gitea#20434)
  Make code review ceckboxes clickable (go-gitea#20481)
  Slightly simplify LastCommitCache (go-gitea#20444)
vsysoev pushed a commit to IntegraSDL/gitea that referenced this pull request Aug 10, 2022
The LastCommitCache code is a little complex and there is unnecessary
duplication between the gogit and nogogit variants.

This PR adds the LastCommitCache as a field to the git.Repository and
pre-creates it in the ReferencesGit helpers etc. There has been some
simplification and unification of the variant code.

Signed-off-by: Andrew Thornton <art27@cantab.net>
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
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. type/refactoring Existing code has been cleaned up. There should be no new functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants