Comments (7)
you can workaround this with the following configuration
mix_path: "cd my_app && mix",
from elixir_git_hooks.
Closing this issue as it should be fixed in the latest release
from elixir_git_hooks.
+1
from elixir_git_hooks.
It's been a while, but this got fixed 49ca50e
I just tested a submodule project and the hooks are installed under .git/modules/my-other-project/hooks/
@colinsmetz can you check the pre-release v0.6.6-pre
?
from elixir_git_hooks.
I don't use submodules, so I'm not sure my issue was clear.
I just tried again using the tag v0.6.6-pre
and I mostly have the same behaviours :
- The git hook is installed in
my_app/deps/.git/pre-commit
when I do amix compile
- If I run
mix git_hooks.install
it uses mygit_path
. There was a difference though. With thegit_path
set to../.git
(as I did before), the pre-commit hook is created at.git/pre-commit
instead of.git/hooks/pre-commit
. I had to set it to../git/hooks
now. - The pre-commit script does not
cd
inside the folder with the Elixir project, so it fails
Note that I may have misunderstood the point of git_path
. Is it limited to git submodules only?
from elixir_git_hooks.
you can workaround this with the following configuration
mix_path: "cd my_app && mix",
Thanks, that solves my last point indeed.
from elixir_git_hooks.
I don't use submodules, so I'm not sure my issue was clear.
I just tried again using the tag
v0.6.6-pre
and I mostly have the same behaviours :* The git hook is installed in `my_app/deps/.git/pre-commit` when I do a `mix compile` * If I run `mix git_hooks.install` it uses my `git_path`. There was a difference though. With the `git_path` set to `../.git` (as I did before), the pre-commit hook is created at `.git/pre-commit` instead of `.git/hooks/pre-commit`. I had to set it to `../git/hooks` now. * The pre-commit script does not `cd` inside the folder with the Elixir project, so it fails
Note that I may have misunderstood the point of
git_path
. Is it limited to git submodules only?
git_path
is not limited to submodules, actually, it should not be used on git submodules and this project supports them out of the box without any additional configuration.
I just tested an elixir project in a subfolder, and the following config installed the hooks on the correct parent path when running mix deps.compile git_hooks
.
config :git_hooks,
git_path: "../.git",
auto_install: true,
verbose: true,
hooks: [
pre_commit: [
tasks: [
{:mix_task, :format, ["--dry-run", "--check-formatted"]}
]
]
]
I don't link the git_path
config, the name is misleading and the path should be resolved automatically. So thanks to the changes on this PR you won't need to set any custom path, it will just work (hopefully).
I just tested myself with both git submodules and a simple elixir subfolder (no submodule) and both the install and the hooks worked fine. There is a pre-release available on hex.
from elixir_git_hooks.
Related Issues (20)
- With older git returns an error HOT 2
- Don't run the hook when nothing in the project root has changed HOT 1
- 0.6.5 release HOT 2
- Add support to mix tasks results HOT 1
- Compilation error when export `deps_path` is set HOT 13
- mono-repo with multiple applications HOT 5
- git_hooks.run not found HOT 1
- mix compile --warnings-as-errors succeeds, but git_hooks registers as a failure HOT 3
- Pre commit/push hooks fail in the latest version HOT 13
- Document how to override the MIX_ENV when running hooks HOT 5
- feature request: allow tasks to be configured to run in parallel HOT 1
- Confusion after rebuilding dependencies until git_hooks.install HOT 7
- Seeing please ensure :git_hooks exists or remove the configuration. HOT 2
- Using && within a :cmd appears to be a problem?
- Running pre-commit hook only for staged files
- Cut a new release with updated dependencies HOT 2
- Pre-commit hook appears execute after commit has taken place HOT 10
- [Feature request] overriding the git hook so that we can make it run mix tasks inside of docker compose HOT 6
- Configurability to run hooks only on a certain branch HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elixir_git_hooks.