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
Pre-commit Hook #178
Comments
Why are you adding the gitginore file to the ignore list? I agree that a hook would be nice to keep the ignores up to date since I do it every time anyway but it seems like you have one step too many in here. |
@alerque Sorry, you're correct. When re-running |
I can add a hook before |
@alerque is correct that you don't need to re-add the gitignore file each time you regenerate the gitignore file (you do have to add it initially). That was tangential to the main point though: It would be nice to have have a way (through hooks) that could be used to rewrite the vcsh repo gitignore file each time a new file is commited to the repo (i think on commit would be more appropriate then when staged, since, since a staged file may be removed, leaving files that were never commited in the ignore file). To do this, I'd just need a pre-commit hook, so I can enumerate the files in the work tree, compare them against the files in ignore file, and if they differ, execute |
@nfarrar did you play with the existing |
Would it be possible to add a pre-commit hook? Specifically - I'm looking at using it to automatically write vcsh gitignore files and simplify this workflow. Right now there are a bunch of steps:
vcsh write-gitignore <repo_name>
When adding a new file, you either need to manually edit the gitignore file to include the new file you want to commit, or commit the file using the
-f
flag, rerunvcsh write-gitignore <repo>
, and then re-add the gitignore file to the gitignore file.Instead, I'd like to just add a pre-commit hook (except it doesn't exist) to:
The text was updated successfully, but these errors were encountered: