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

Installs git hook even when rusty-hook command is not available #140

Open
kornelski opened this issue Jan 19, 2021 · 4 comments
Open

Installs git hook even when rusty-hook command is not available #140

kornelski opened this issue Jan 19, 2021 · 4 comments

Comments

@kornelski
Copy link

I'm not a rusty-hook user, I've only built someone else's crate that has rusty-hook as a dependency, and it broke my git repository by adding pre-commit hooks that expect rusty-hook command in PATH. I don't have one, so I can't commit.

Please try to detect whether rusty-hook is installed and is going to work as a pre-commit hook before modifying git repos.

@kornelski
Copy link
Author

Also, rusty-hook has modified the wrong repository. I have a Cargo workspace like this:

.git # this got modified :(
Cargo.toml # not using rusty-hook
git-submodule-third-party-crate/
   .git # this should have been modified, if any
   Cargo.toml # uses rusty-hook

@calebcartwright
Copy link
Member

Thanks for reaching out. Could you answer two questions for us so that we have a better understanding of the circumstances and are better able to troubleshoot:

  • What's the version of rusty-hook used by the project in this git submodule you're using?
  • Do you have cargo's bin directory on your path?

@kornelski
Copy link
Author

kornelski commented Jan 19, 2021

Thank you for checking it out.

The submodule has:

[dev-dependencies]
rusty-hook = "^0.10.1" # v0.10.3

I do have .cargo/bin in PATH, and I don't have rusty-hook binary installed anywhere.

@calebcartwright
Copy link
Member

Interesting 🤔. The hook scripts will also perform bootstrapping if necessary, including the CLI which should have resulted in the executable existing under the cargo bin directory.

Was there any output in your terminal from running the git command that triggered the first hook you could share?

Also, totally understood if you already have (or want to) nuke the hook files in the .git/hooks directory to get things sorted again in your local workspace, we can attempt to reproduce on our end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants