aboutsummaryrefslogtreecommitdiff
path: root/git-hooks
AgeCommit message (Collapse)Author
2014-04-28Update `--help` outputZearin
* No longer using `--severalunseparatewords` (but still accepts them for backwards compatibility) * Use `<angled brackets>` for mandatory arguments (`[square brackets]` are for optional arguments)
2014-04-28Use consistent function namesZearin
2014-04-28Use consistent braces for functionsZearin
2014-04-28Put related functions next to each otherZearin
2014-02-17Handle repository paths that contains spacesBenjamin C Meyer
Issue #33 Signed-off-by: Benjamin C Meyer <ben@meyerhome.net>
2013-11-06Add the ability to remind users when committing to any repo without git-hooks.Benjamin C Meyer
It is easy to forget to install git-hooks in a repository you are using. A commit with no error message could both mean you don't have git-hooks installed and it can mean that you do have it installed, but your commit was perfect and there was no errors. The new option --installglobal creates a default .git template that is used by all future cloned repositories (and git init'd) that remind users that the repository doesn't have git-hooks installed. A number of projects I have been involved with used git-hooks, but founds its weakest point was that eventually someone would re-clone a repo and make commits with errors before turning git-hooks back on. Another common problem was when we had multiple git repositories and git-hooks was only installed in some of them, but not all While it would be nice to be able to use --instalglobal to automatically turn on git-hooks on every future repo eventually some git repository on github would include a hook that would email <secret stuff> back home and all you would have to do would be to clone it to activate it which would be a "bad thing", but it can pester you without harm. Signed-off-by: Benjamin C Meyer <ben@meyerhome.net>
2013-11-06Behave much better when not in a git repositoryBenjamin C Meyer
or when the repository is a bare repository Signed-off-by: Benjamin C Meyer <ben@meyerhome.net>
2013-11-06Add support for Git on windows where find doesn't have the -L optionBenjamin C Meyer
Signed-off-by: Benjamin C Meyer <ben@meyerhome.net>
2013-10-23If git hooks isn't installed explicitly say how to install itBenjamin C Meyer
Signed-off-by: Benjamin C Meyer <ben@meyerhome.net>
2013-10-23In the event we can't rename hooks we should immediately fail.Benjamin C Meyer
Signed-off-by: Benjamin C Meyer <ben@meyerhome.net>
2013-10-20Fix too many hooks reported in list_hooks_in_dirGeorg Lutz
list_hooks_in_dir should report exactly the hooks that would be run with run_hooks. But the find command in list_hooks_in_dir does not limit itself to the scheme "folder_name/hook_name" but recurses infinitely through sub directories reporting all executable files. If your hooks are stored itself in a git repository then consequently also the files in .git/hooks are reported. This change sets the search depth exactly to two, so that the correct scripts are reported, e.g. : ~/.git_hooks/commit-msg/script1 but not e.g. : ~/.git_hook/.git/hooks/commit-msg ~/.git_hooks/script2 ~/.git_hooks/commit-msg/dir2/script3 Signed-off-by: Benjamin C Meyer <ben@meyerhome.net>
2013-10-20Use /usr/bin/env in generated hook scriptsBenjamin C Meyer
Signed-off-by: Benjamin C Meyer <ben@meyerhome.net>
2013-10-20Add support for pre-push commit hook that was added in Git 1.8.2Benjamin C Meyer
Signed-off-by: Benjamin C Meyer <ben@meyerhome.net>
2013-07-22using /usr/bin/envMikhail Troshev
bash can be placed in /usr/local/bin on FreeBSD
2012-02-13Fix icefox/git-hooks#9: -L arg to find must precede path to find fromSergey Belov
2012-01-25Don't re-install.Jeremy Dunck
Signed-off-by: Benjamin C Meyer <ben@meyerhome.net>
2012-01-25When we find hooks also look for symbolic links.Benjamin C Meyer
Signed-off-by: Benjamin C Meyer <ben@meyerhome.net>
2012-01-25Add another standard-help-flagOluf Lorenzen
Signed-off-by: Benjamin C Meyer <ben@meyerhome.net>
2012-01-25Remove non-posix shell command flags which is causing problems across OS's.Benjamin C Meyer
Signed-off-by: Benjamin C Meyer <ben@meyerhome.net>
2012-01-25Fix whitespace errors introduced byBenjamin C Meyer
7502217953a8e8e5b56f0a531a16cfc14b825e82 Signed-off-by: Benjamin C Meyer <ben@meyerhome.net>
2012-01-24Correct the copyright year and add a LICENSE file.Benjamin C Meyer
2011-09-16Lion compability.Daniel Eriksson
2011-09-05Change my mind on the previous commit making the new default .githooksBenjamin C Meyer
not .hooks to match other .git* files/directories. Signed-off-by: Benjamin C Meyer <ben@meyerhome.net>
2011-09-01Fix OS X sort -V breakageBenjamin C Meyer
The -V option to sort is not include in OS X's sort so special case OS X. Signed-off-by: Benjamin C Meyer <ben@meyerhome.net>
2011-09-01Include the directory .hooks inside the repository as one of the directories ↵Benjamin C Meyer
that are searched. Signed-off-by: Benjamin C Meyer <ben@meyerhome.net>
2010-06-19When listing hooks don't change the cwd, just use the GITDIR variableBenjamin C Meyer
Signed-off-by: Benjamin C Meyer <ben@meyerhome.net>
2010-06-19When listing the hook_dirs use GITDIR for the project hooksBenjamin C Meyer
Signed-off-by: Benjamin C Meyer <ben@meyerhome.net>
2010-06-19When listing hooks use GITDIR and pipe stderr to dev/nullBenjamin C Meyer
Signed-off-by: Benjamin C Meyer <ben@meyerhome.net>
2010-06-19If the hooks are installed or not is important, put it on its own line in ↵Benjamin C Meyer
the output Signed-off-by: Benjamin C Meyer <ben@meyerhome.net>
2010-06-19Allow git config path to contain $HOME or other shell variables by expanding ↵Benjamin C Meyer
them with eval. Signed-off-by: Benjamin C Meyer <ben@meyerhome.net>
2010-06-19When listing hooks, the dir should always be a dir, so add / to the end of ↵Benjamin C Meyer
the dir. This allows the dir to be a symlink. Signed-off-by: Benjamin C Meyer <ben@meyerhome.net>
2010-06-19When a hook returns with non-zero report which hook last ran before exitingBenjamin C Meyer
Signed-off-by: Benjamin C Meyer <ben@meyerhome.net>
2010-06-19Use rev-parse --git-dir to determine the location of the GITDIR.Benjamin C Meyer
Signed-off-by: Benjamin C Meyer <ben@meyerhome.net>
2010-06-19Only set the hook variable when an argument is passed to hook_dirs, ↵Benjamin C Meyer
otherwise hook will be '/' and if there is no git config option will result in / being returned as a valid git hook which it is not Signed-off-by: Benjamin C Meyer <ben@meyerhome.net>
2010-06-19When printing the status claify that git-hooks is not installed in the ↵Benjamin C Meyer
current repository, not in general. Signed-off-by: Benjamin C Meyer <ben@meyerhome.net>
2010-06-19Change license of all code from the 4 clause license to the 3 clause licenseBenjamin C Meyer
Signed-off-by: Benjamin C Meyer <ben@meyerhome.net>
2010-03-20Remove variable the is no longer usedBenjamin C Meyer
Signed-off-by: Benjamin C Meyer <ben@meyerhome.net>
2010-03-20Verify that all required arguments are passed in and return with anBenjamin C Meyer
error if they are not. Signed-off-by: Benjamin C Meyer <ben@meyerhome.net>
2010-03-19Write up correct documentation for when git hooks --help is called.Benjamin C Meyer
Signed-off-by: Benjamin C Meyer <ben@meyerhome.net>
2010-03-19Only echo the name of the script and hook if GIT_HOOKS_VERBOSE is set.Benjamin C Meyer
Signed-off-by: Benjamin C Meyer <ben@meyerhome.net>
2010-03-19Display both the hook name and script nameBenjamin C Meyer
Signed-off-by: Benjamin C Meyer <ben@meyerhome.net>
2010-03-19Rather than using an environment variable just use the configurationBenjamin C Meyer
option hooks.global. Signed-off-by: Benjamin C Meyer <ben@meyerhome.net>
2010-03-17Initial stab at the git-hooks script that will run user, application, and ↵Benjamin C Meyer
global hooks. Signed-off-by: Benjamin C Meyer <ben@meyerhome.net>