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

Proposal: make Gitea use its own customized global config #19709

Closed
wxiaoguang opened this issue May 15, 2022 · 1 comment · Fixed by #19732
Closed

Proposal: make Gitea use its own customized global config #19709

wxiaoguang opened this issue May 15, 2022 · 1 comment · Fixed by #19732
Labels
type/proposal The new feature has not been accepted yet but needs to be discussed first.

Comments

@wxiaoguang
Copy link
Contributor

wxiaoguang commented May 15, 2022

Background

In history, Gitea uses default (system/global) git config file. It would cause a problem: conflicting with user's git config if the Gitea instance is running without isolation. Related:

Proposal

According to: https://git-scm.com/docs/git-config#_environment , set GIT_CONFIG_GLOBAL to use a git config inside Gitea's data directory, and set GIT_CONFIG_NOSYSTEM to skip the system git config.

Update: at the moment, GIT_CONFIG_GLOBAL is not used because it's only supported by new Git. To make Gitea work with some old Git, the internal git HOME environment is used. And GIT_CONFIG_NOSYSTEM is still supported, in case some users need to put some config options in it.

Benefits

Then Gitea can set any git option it needs in its own customized git config. And it avoids unexpected git problems caused by user's incorrect git config.

Breaking or not

To upgrade from an existing Gitea instance (there is no customized git config for Gitea yet):

  • Breaking way: if there is no customized git config for Gitea, then ignore the existing git config and create a new customized git config for Gitea from scratch. If some users ever set some options for Gitea in their global/system git config, this way would lose these options. Users can set these options in the customized git config manually later.

  • Non-breaking way: copy the existing global/system git config options into the customized git config. This way would bring in some unrelated (maybe incorrect) config options.

In my mind the Breaking way is the preferred method, because it's clear, and normally users shouldn't have set any Gitea-related options in their git config. So it's not that breaking indeed.

Reference

@wxiaoguang wxiaoguang added the type/proposal The new feature has not been accepted yet but needs to be discussed first. label May 15, 2022
@wxiaoguang wxiaoguang linked a pull request May 17, 2022 that will close this issue
@wxiaoguang
Copy link
Contributor Author

The PR is ready for review. More complex than I thought because various reasons .....

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant