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

[high] sometimes comment files end up staged but not committed #9

Open
masukomi opened this issue Mar 17, 2022 · 1 comment
Open

[high] sometimes comment files end up staged but not committed #9

masukomi opened this issue Mar 17, 2022 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@masukomi
Copy link
Owner

masukomi commented Mar 17, 2022

i tried deleting a comment and got this error. The file was created with v1.2.4

error: the following file has changes staged in the index:
    19e5df/c950fe18f67af13fb7ef0dc55a7d0427dd00dfbf9bb6d764a4a7d55f37f6f715-542.json
(use --cached to keep the file, or -f to force removal)

investigation reveals that the problem is that git config --get init.templatedir is defined and i have a pre-commit hook in there that checks for "bad" words. In this case i left a comment with "TODO" which is a bad word which prevents a commit from happening.

Any pre-commit hook is potentially problematic because it could prevent the commit from succeeding and private comments doesn't currently check the exit status and error appropriately.

@masukomi masukomi added the bug Something isn't working label Mar 17, 2022
@masukomi masukomi self-assigned this Mar 17, 2022
@masukomi
Copy link
Owner Author

things i've tried

  • specifying --template=bogus-dir
  • creating a .gitconfig in the same dir before running git init and have the config specify a bogus template dir

no matter what i try my template dir stuff gets copied in and pre-commit hooks are run.

i THINK the next step is to

  • initialize the repo
  • check for the existence of .git/hooks/pre-commit in the new repo and delete, or rename it, it if it exists

as this repo is JUST for us i don't feel bad about hosing pre-commit hooks.

TODO (assuming this works)

add a note to the README noting that pre-commit hooks will be disabled in private_comments repos.

if we rename it then folks can say what we did and folks can go un-rename it if they really reallllly want it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant