Comments (7)
FYI: In https://github.com/gabyx/Githooks we run them internally.
from lefthook.
We support this list of hooks:
https://github.com/Arkweid/lefthook/blob/master/cmd/install.go#L18-L36
from lefthook.
I'm trying to get Lefthook to run Git LFS' suggested pre-push hook:
#!/bin/sh
git lfs pre-push "$@"
but when it gets executed by Lefthook, it hangs indefinitely. I believe this is because git lfs pre-push
is trying to read from stdin
, as is documented here:
Information about what is to be pushed is provided on the hook’s standard input with lines of the form:
<local ref> SP <local sha1> SP <remote ref> SP <remote sha1> LF
Does Lefthook pass this information to scripts? Or am I doing something wrong? Thanks!
from lefthook.
Lefthook pass information from script into. But I don't sure about this case.
You can check .git/hooks/pre-push
file for debug it.
from lefthook.
This should be documented somewhere as a side effect, otherwise lefthook will override it:
Oh sorry, that does not work, it prints:
This should be run through Git's pre-push hook. Run `git lfs update` to install it.
post-commit:
commands:
lfs:
run: git lfs post-commit {0}
pre-push:
commands:
lfs:
run: git lfs pre-push {0}
post-checkout:
commands:
lfs:
run: git lfs post-checkout {0}
post-merge:
commands:
lfs:
run: git lfs post-merge {0}
from lefthook.
Still, I think this can be re-opened, git lfs hooks aren't executed and therefore lfs changes aren't pushed to the server. Adding lfs hooks to lefthook does not work, idk what lfs is missing in path, but it exits silently and lefthook will hang. I did not find any workaround yet...
Simple question: would it work importing lfs as a go-mod and use it directly "if it is installed"?
from lefthook.
@gabyx cool, thanks! Unfortunately, the reason we use lefthook is that I can easily install it via Homebrew (or others) and with NPM, which we use, since some of our employees use windows and have all kind of problems installing binaries ^^.
from lefthook.
Related Issues (20)
- Remote sync failures HOT 5
- Include git output when commands fail HOT 1
- npm: Not working with bun without node HOT 7
- lefthook.yml is automatically added when using my library HOT 4
- `stage_fixed`: `Couldn't stage fixed files:fork/exec C:\Program Files\Git\mingw64\bin\git.exe: The filename or extension is too long.` on Windows HOT 2
- Pass `--all-files` flag to the command being run during the hook HOT 4
- Performance for `npm` could be even more faster? HOT 4
- submit logo to simple-icon HOT 1
- Error: Cannot find module 'lefthook-linux-x64/bin/lefthook' on git commit after updating npm dependency to 1.6.10 HOT 8
- "no matching staged files" error when I ran "pre-commit" manually HOT 2
- `exclude` configuration as array
- Error message when lefthook is older could include more info HOT 1
- Prepackaged PHP Composer
- It was detected as a virus. HOT 3
- lefthook fails git command when run with GIT_TRACE=1 HOT 1
- Option to redirect standard input to `/dev/null` HOT 5
- fetch new scripts automatically when remote scripts changed HOT 1
- new feature refetch remotes config sync hooks fail HOT 15
- Paths with brackets parsed incorrectly in Windows environment HOT 3
- 1.6.16 not available in apt/rpm repos 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 lefthook.