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

Adjust object format interface #28469

Merged
merged 16 commits into from
Dec 17, 2023
Merged

Conversation

lunny
Copy link
Member

@lunny lunny commented Dec 14, 2023

  • Remove ObjectFormatID
  • Remove function ObjectFormatFromID.
  • Use Sha1ObjectFormat directly but not a pointer because it's an empty struct.
  • Store ObjectFormatName in repository struct

@lunny lunny added the type/refactoring Existing code has been cleaned up. There should be no new functionality. label Dec 14, 2023
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Dec 14, 2023
@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Dec 14, 2023
@github-actions github-actions bot added the modifies/api This PR adds API routes or modifies them label Dec 14, 2023
@AdamMajer
Copy link
Contributor

One problem I see is that there will be no way to serialize ObjectFormat to database and back. This will be needed to support more than one hash format.

@lunny
Copy link
Member Author

lunny commented Dec 14, 2023

One problem I see is that there will be no way to serialize ObjectFormat to database and back. This will be needed to support more than one hash format.

We can store ObjectFormat.String() into database. Like

ObjectFormatName string `xorm:"VARCHAR(8)"`

@AdamMajer
Copy link
Contributor

@lunny
Copy link
Member Author

lunny commented Dec 14, 2023

Correct, but deselialization function needs to be restored.

https://github.com/go-gitea/gitea/pull/28469/files#diff-714e92cc5c5c0bab436167cd92913b2780a67a0180808a35d17fa11e25005399L94

Updated in 619483a

@GiteaBot GiteaBot removed the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Dec 14, 2023
@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Dec 14, 2023
@pull-request-size pull-request-size bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 15, 2023
@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 Dec 15, 2023
@pull-request-size pull-request-size bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Dec 17, 2023
@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Dec 17, 2023
@lunny lunny enabled auto-merge (squash) December 17, 2023 11:55
@lunny lunny merged commit 408a484 into go-gitea:main Dec 17, 2023
25 checks passed
@GiteaBot GiteaBot added this to the 1.22.0 milestone Dec 17, 2023
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Dec 17, 2023
@lunny lunny deleted the lunny/adjust_object_format branch December 17, 2023 11:56
zjjhot added a commit to zjjhot/gitea that referenced this pull request Dec 19, 2023
* giteaofficial/main:
  [skip ci] Updated translations via Crowdin
  Add option to disable ambiguous unicode characters detection (go-gitea#28454)
  Adjust object format interface (go-gitea#28469)
  Remove duplicate option in admin screen and now-unused translation keys (go-gitea#28492)
  [skip ci] Updated translations via Crowdin
  Initalize stroage for orphaned repository doctor (go-gitea#28487)
fuxiaohei pushed a commit to fuxiaohei/gitea that referenced this pull request Jan 17, 2024
- Remove `ObjectFormatID`
- Remove function `ObjectFormatFromID`.
- Use `Sha1ObjectFormat` directly but not a pointer because it's an
empty struct.
- Store `ObjectFormatName` in `repository` struct
AdamMajer pushed a commit to AdamMajer/gitea that referenced this pull request Jan 22, 2024
- Remove `ObjectFormatID`
- Remove function `ObjectFormatFromID`.
- Use `Sha1ObjectFormat` directly but not a pointer because it's an
empty struct.
- Store `ObjectFormatName` in `repository` struct
silverwind pushed a commit to silverwind/gitea that referenced this pull request Feb 20, 2024
- Remove `ObjectFormatID`
- Remove function `ObjectFormatFromID`.
- Use `Sha1ObjectFormat` directly but not a pointer because it's an
empty struct.
- Store `ObjectFormatName` in `repository` struct
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Mar 16, 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. modifies/api This PR adds API routes or modifies them size/L Denotes a PR that changes 100-499 lines, ignoring generated files. 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.

5 participants