path: root/templates
AgeCommit message (Collapse)Author
2006-04-19pre-commit hook: complain about conflict markers.Junio C Hamano
Several <<< or === or >>> characters at the beginning of a line is very likely to be leftover conflict markers from a failed automerge the user resolved incorrectly, so detect them. As usual, this can be defeated with "git commit --no-verify" if you really do want to have those files, just like changes that introduce trailing whitespaces. Signed-off-by: Junio C Hamano <>
2006-02-26Merge branch 'maint'Junio C Hamano
* maint: sample hooks template.
2006-02-26sample hooks template.Junio C Hamano
These two sample hooks try to detect and use the corresponding commit hook from the same repository. However, they forgot to set up GIT_DIR for their own use, so was not in effect. Signed-off-by: Junio C Hamano <>
2006-02-13rebase: allow a hook to refuse rebasing.Junio C Hamano
This lets a hook to interfere a rebase and help prevent certain branches from being rebased by mistake. A sample hook to show how to prevent a topic branch that has already been merged into publish branch. Signed-off-by: Junio C Hamano <>
2006-01-30Merge fixes up to GIT 1.1.6Junio C Hamano
2006-01-29[PATCH] pre-commit sample hook: do not barf on the initial importJunio C Hamano
The example hook barfs on the initial import. Ideally it should produce a diff from an empty tree, but for now let's stop at squelching the bogus error message. Often an initial import involves tons of badly formatted files from foreign SCM, so not complaining about them like this patch does might actually be a better idea than enforcing the "Perfect Patch" format on them. Signed-off-by: Junio C Hamano <>
2006-01-25sample update-hook: sanely handle a new branch head.Junio C Hamano
Instead of showing all the history since the beginning of time leading to the the branch head, show only the changes this new branch brings to the world. This originally came from Linus and tested by Andreas Ericsson. Signed-off-by: Junio C Hamano <>
2006-01-25update-hook: Major overhaul (handling tags, mainly).Andreas Ericsson
This is the update hook we use in all our git-repos. It has some improvements over the original version, namely: * Don't send every commit since dawn of time when adding a new tag. * When updating an annotated tag, just send the diffs since the last tag. * Add diffstat output for 'normal' commits (top) and annotated tags (bottom). * Block un-annotated tags in shared repos. I'm a bit uncertain about that last one, but it demonstrates how to disallow updates of a ref which we use, so I kept it. Note that git-describe is needed for the "changes since last annotated tag" thing to work. Signed-off-by: Andreas Ericsson <> Signed-off-by: Junio C Hamano <>
2005-11-21Fix hooks/update template.Junio C Hamano
Make the example address RFC2606 (aka BCP0032) compliant. Also fix a couple of shell script errors. Noted and fixed by Matthew Wilcox and Andreas Ericsson. Signed-off-by: Junio C Hamano <>
2005-11-08Clean build annoyance.Junio C Hamano
As Pasky pointed out, building in templates directory showed list of built template files which was unneeded. This commit also fixes another build annoyance I recently left in by accident. Signed-off-by: Junio C Hamano <>
2005-10-15Add new programs and stamp file to .gitignore.Tom Prince
Signed-off-by: Tom Prince <> Signed-off-by: Junio C Hamano <>
2005-10-10Deal with $(bindir) and friends with whitespaces.Junio C Hamano
... using HPA's shellquote macro. Signed-off-by: Junio C Hamano <>
2005-10-09Make sure 'make install' does not have to rebuild templates.Junio C Hamano
The dependency rule in templates directory forced 'make install' that immediately followed 'make all' to rebuild boilerplates. This was problematic for a workflow that built first as yourself and then installed as root, from a working tree that is on an NFS mounted filesystem that is unwritable by root. Signed-off-by: Junio C Hamano <>
2005-09-24Solaris: give a bit more built-in defaults.Junio C Hamano
Taking the make command line Peter Eriksen uses, give defaults to SHELL_PATH, TAR, CURLDIR, NO_STRCASESTR, and INSTALL. Signed-off-by: Junio C Hamano <>
2005-09-08Big tool rename.Junio C Hamano
As promised, this is the "big tool rename" patch. The primary differences since 0.99.6 are: (1) git-*-script are no more. The commands installed do not have any such suffix so users do not have to remember if something is implemented as a shell script or not. (2) Many command names with 'cache' in them are renamed with 'index' if that is what they mean. There are backward compatibility symblic links so that you and Porcelains can keep using the old names, but the backward compatibility support is expected to be removed in the near future. Signed-off-by: Junio C Hamano <>
2005-09-02scripts: equality test '==' is not portable.Junio C Hamano
On NetBSD 3 we trigger an error: [: ==: unexpected operator Double-equal is accepted by bash built-in '[' and bash(1) suggests using '=' for strict POSIX compliance (test(1) from coreutils does not mention '=='). Eradicate their uses everywhere. [jc: Somebody with a pseudonym kindly sent a message to let me know about the problem privately; I do not have access to a NetBSD box.] Signed-off-by: Junio C Hamano <>
2005-08-26[PATCH] git bugfixes and cleanups, mainly Debian thingsTommi Virtanen
Ignore generated files. Signed-off-by: Tommi Virtanen <> Signed-off-by: Junio C Hamano <>
2005-08-24[PATCH] Use .git/remote/origin, not .git/branches/origin.Junio C Hamano
Now multi-head fetch is complete, let's migrate the default configuration for new repositories created with the "git clone" command. The original $GIT_DIR/branches is not deprecated yet, but create remotes directory by default from the templates as well. Signed-off-by: Junio C Hamano <>
2005-08-20[PATCH] Fix git-commit-script to output on stderr when -v failsMarco Costalba
When git-commit-script is called with -v option and verify test fails result is print on stdout instead of stderr. [jc: The original patch from Marco updated git-commit-script that still had the piece of code in question, which has been moved to an example hook script on its own, so I transplanted the patch to that new file instead.] Signed-off-by: Marco Costalba <> Signed-off-by: Junio C Hamano <>
2005-08-20Make sample pre-commit hook output Emacs friendly.Junio C Hamano
Use the common error message format, "filename:lineno: body"; this way, problematic lines can be jumped to from the Emacs compilation buffer by C-x `. Signed-off-by: Junio C Hamano <>
2005-08-19Add hooks to tools/git-applypatch.Junio C Hamano
This teachs git-applypatch, which is used from git-applymbox, three hooks, similar to what git-commit-script uses. Signed-off-by: Junio C Hamano <>
2005-08-19Add commit hook and make the verification customizable.Junio C Hamano
There are three hooks: - 'pre-commit' is given an opportunity to inspect what is being committed, before we invoke the EDITOR for the commit message; - 'commit-msg' is invoked on the commit log message after the user prepares it; - 'post-commit' is run after a successful commit is made. The first two can interfere to stop the commit. The last one is for after-the-fact notification. The earlier built-in commit checker is now moved to pre-commit. Signed-off-by: Junio C Hamano <>
2005-08-15[PATCH] Fixed/Extended example for update hookJosef Weidendorfer
Add sample code to distinguish --force rebased head and simple fast-forward. At the same time fixes a real bug; the "new ref" path was using a wrong parameter. Signed-off-by: Junio C Hamano <>
2005-08-12[PATCH] Use $DESTDIR instead of $destPetr Baudis
$DESTDIR is more usual during the build than $dest and is what is usually used in the makefiles, so let's use it too. Signed-off-by: Petr Baudis <> Signed-off-by: Junio C Hamano <>
2005-08-06Redo the templates generation and installation.Junio C Hamano
Per discussion with people interested in binary packaging, change the default template location from /etc/git-core to /usr/share/git-core hierarchy. If a user wants to run git before installing for whatever reason, in addition to adding $src to the PATH environment variable, git-init-db can be run with --template=$src/templates/blt/ parameter. Signed-off-by: Junio C Hamano <>
2005-08-03Install sample hooksJunio C Hamano
A template mechanism to populate newly initialized repository with default set of files is introduced. Use it to ship example hooks that can be used for update and post update checks, as Josef Weidendorfer suggests. Signed-off-by: Junio C Hamano <>