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

Move duplicated functions #33977

Merged
merged 4 commits into from
Mar 25, 2025
Merged

Conversation

lunny
Copy link
Member

@lunny lunny commented Mar 22, 2025

Remove duplicated functions IsExist, IsFile and IsDir in package modules/git and use the exists functions in modules/util.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Mar 22, 2025
@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Mar 22, 2025
@lunny lunny added type/refactoring Existing code has been cleaned up. There should be no new functionality. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 22, 2025
@github-actions github-actions bot added the modifies/go Pull requests that update Go code label Mar 22, 2025
@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Mar 22, 2025
Copy link
Contributor

@wxiaoguang wxiaoguang left a comment

Choose a reason for hiding this comment

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

Move ConcatenateError to package modules/util.

No, do not do that. It was a bad design and do not make other packages use it.

@GiteaBot GiteaBot added the lgtm/blocked A maintainer has reservations with the PR and thus it cannot be merged label Mar 23, 2025
@lunny
Copy link
Member Author

lunny commented Mar 23, 2025

Move ConcatenateError to package modules/util.

No, do not do that. It was a bad design and do not make other packages use it.

It has been used by many other packages.

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Mar 23, 2025

It has been used by many other packages.

These are still "git" related. You can't put it into "util", no other package should use it. No error system should be designed that way.

image

@pull-request-size pull-request-size bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 23, 2025
@lunny
Copy link
Member Author

lunny commented Mar 23, 2025

It has been used by many other packages.

These are still "git" related. You can't put it into "util", no other package should use it. No error system should be designed that way.

image

ace647d

@wxiaoguang wxiaoguang dismissed their stale review March 23, 2025 07:13

dismiss

@GiteaBot GiteaBot added lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. and removed lgtm/blocked A maintainer has reservations with the PR and thus it cannot be merged labels Mar 23, 2025
@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 Mar 25, 2025
@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 Mar 25, 2025
@lunny lunny enabled auto-merge (squash) March 25, 2025 14:15
@lunny lunny merged commit d6e94fa into go-gitea:main Mar 25, 2025
26 checks passed
@GiteaBot GiteaBot added this to the 1.24.0 milestone Mar 25, 2025
@lunny lunny deleted the lunny/merge_duplicated_funcs branch March 25, 2025 23:58
zjjhot added a commit to zjjhot/gitea that referenced this pull request Mar 26, 2025
* giteaofficial/main:
  Enable color output in govulncheck (go-gitea#34012)
  Update Makefile test comments (go-gitea#34013)
  Move duplicated functions (go-gitea#33977)
  Git client will follow 301 but 307 (go-gitea#34005)
  Prepare common tmpl functions in a middleware (go-gitea#33957)
  Update go mod dependencies (go-gitea#33988)
  Fix some migration and repo name problems (go-gitea#33986)
  [skip ci] Updated translations via Crowdin
  Use filepath.Join instead of path.Join for file system file operations (go-gitea#33978)
  Add changelog for 1.23.6 (go-gitea#33975)
  Fix incorrect code search indexer options (go-gitea#33992)
  Auto expand "New PR" form (go-gitea#33971)
  Move ParseBool to optional (go-gitea#33979)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/go Pull requests that update Go code size/M Denotes a PR that changes 30-99 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