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

[FEAT] Add config rule command #62

Open
b4nst opened this issue Mar 7, 2021 · 0 comments
Open

[FEAT] Add config rule command #62

b4nst opened this issue Mar 7, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@b4nst
Copy link
Owner

b4nst commented Mar 7, 2021

Is your feature request related to a problem? Please describe.

Turbogit rely on bare git workflow, enhancing it with some useful high level, highly opinionated commands. In that sense it uses and should keep using the bare git config model. This model is well known and fit every configuration needs of turbogit.
However more and more features rely on some critical configuration keys (like integrations, commit type referenced in #57, and more to come). Making sure every instances of a given repository follow the same configuration is cumbersome and error prone. Sharing the git config itself is highly discouraged due to possible sensitive information leak.

Describe the solution you'd like

We could add a rule system as an init hook call before every turbogit command. This hook would ensure that your current config matches a set of given rules. This set of rules would be defined by some hard-coded rules (to avoid breaking conventions that turbogit is designed to enforce) merged with user-defined rules. The latter would lay in a per-repo file with a simple well known format (toml, yaml, etc...)

To speed up the hook execution, a hash (sum of rules) of last checked rules would be written inside a dedicated key (tug.rules?) in the local git config. This way rules are tested only if this hash doesn't exist or doesn't match the current set of rules.

A command could also be added to manage this ruleset (list,add,remove,update rules).

Additional context

@b4nst b4nst added the enhancement New feature or request label Mar 7, 2021
@b4nst b4nst changed the title [FEAT] add config rule command [FEAT] Add config rule command Mar 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant