wildfish / git-hooks Goto Github PK
View Code? Open in Web Editor NEWA tool for organising your hooks
License: MIT License
A tool for organising your hooks
License: MIT License
Looks like we are getting the error because refs/heads/master
doesn't already exist
Traceback (most recent call last):
File ".git/hooks/pre-commit", line 7, in <module>
sys.exit(runners.PreCommitHookRunner().run())
File "/home/dan/.virtualenvs/git-hooks/lib/python3.4/site-packages/githooks/runners.py", line 63, in run
args = list(self.get_process_args())
File "/home/dan/.virtualenvs/git-hooks/lib/python3.4/site-packages/githooks/runners.py", line 85, in get_process_args
args += tuple(repo.added_files() + repo.modified_files())
File "/home/dan/.virtualenvs/git-hooks/lib/python3.4/site-packages/githooks/repo.py", line 56, in added_files
return [os.path.join(repo_root_dir, d.a_path) for d in get().head.commit.diff() if d.new_file]
File "/home/dan/.virtualenvs/git-hooks/lib/python3.4/site-packages/git/refs/symbolic.py", line 183, in _get_commit
obj = self._get_object()
File "/home/dan/.virtualenvs/git-hooks/lib/python3.4/site-packages/git/refs/symbolic.py", line 176, in _get_object
return Object.new_from_sha(self.repo, hex_to_bin(self.dereference_recursive(self.repo, self.path)))
File "/home/dan/.virtualenvs/git-hooks/lib/python3.4/site-packages/git/refs/symbolic.py", line 125, in dereference_recursive
hexsha, ref_path = cls._get_ref_info(repo, ref_path)
File "/home/dan/.virtualenvs/git-hooks/lib/python3.4/site-packages/git/refs/symbolic.py", line 157, in _get_ref_info
raise ValueError("Reference at %r does not exist" % ref_path)
ValueError: Reference at 'refs/heads/master' does not exist
I would be useful to be able to run arbitrary commands on your repo that may not be general enough to make a public hook out of (such as ruining tests).
The working directory for the command should be the root of the repo.
Something like:
[run]
pre-commit = command: ./scripts/runtests.sh
command: ./script/otherscript.sh
If files are modified and moved the old name is included in the list of modified files. This should not be the case as hook writers shouldn't have to check is a file exists before processing it.
Something along the lines of:
git hooks run <hook-type> <files>
should be able to run it on all files in the repo if no files are supplied
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.