feat: configure the name of the checksums dir using env. var or git config#181
feat: configure the name of the checksums dir using env. var or git config#181victorciresica wants to merge 1 commit into
Conversation
|
@victorciresica : Thats actually correct, it does not work.
Thanks for providing a PR -> Actually, its nice somebody uses this on Gitea, I once did that long ago too on a company instance. I will have look at the PR =) |
gabyx
left a comment
There was a problem hiding this comment.
Looks good, but needs some changes and discussion.
|
@victorciresica I enabled CI for forked PRs, it might enable when you ammend the commit. |
|
I need to figure out next week why the CI is not running probably due to pipeline.yml which has some wrong settings. @victorciresica : You can run the tests with |
|
@gabyx I did the changes you suggested. It remains just to add update the readme as well. |
911d355 to
77869a8
Compare
|
@victorciresica : The question I have is; When you set a global checksums directory -> this directory could grow and nobody cleans that on Gitea, but you are right there are only a few deliberate hooks the server maintainer sets up so the directory containing the checksums will only be small and of limited size... Also you read that section right: trust all hooks on the Server: # Automatically accept changes to all existing and new
# hooks in the current repository.
# This makes the fatal trust prompt pass.
git hooks config trust-all-hooks --acceptI would just leave the checksum directory local and not set it (rendering this PR actually obsolete ... I will still consider to merge it, since it actually is ok!) https://github.com/gabyx/Githooks/blob/main/docs/cli/git_hooks_shared_add.md
|
|
I did read the section on trust-all-hooks, but it can only be set locally, on one repo at a time. I would like something global. So, I think the feature is still useful. @gabyx what do you think? |
82b824f to
bc79c9b
Compare
bc79c9b to
d91a7bd
Compare
|
@victorciresica : The feature is useful, but needs more work. See the comments above. |
| // Remove checksum files... | ||
| cacheDir := hooks.GetChecksumDirectoryGitDir(gitDir) | ||
| // Remove local checksum files... | ||
| cacheDir := path.Join(gitDir, hooks.ChecksumsDir) |
There was a problem hiding this comment.
question: I dont think this is the correct path now when uninstalling. I think one must do the same computation as in githooks.go + an Env variable which we should check also if set separately and delete that folder too. IMO
I was trying to set centralized server hooks for a gitea instance and I had a problem with having centralized trust configuration because if I create a symbolic link to .githooks.checksums in the gitea init.templateDir it isn't copied in new repos, because it's a hidden directory. So I figured a way to set the name of the checksums' directory would fix my issue.
I don't know if it is Gitea specific, or this might be the case for all git service providers(e.g. gitlab, bitbucket). If it isn't specific to Gitea it will be very useful for others as well.