From a5af0e2c550e68b15a38f02ae1d3c3416f8cf276 Mon Sep 17 00:00:00 2001 From: Christian Couder Date: Fri, 2 May 2008 05:30:47 +0200 Subject: Documentation: rename "hooks.txt" to "githooks.txt" and make it a man page Also now "gitcli(5)" becomes "gitcli(7)". Signed-off-by: Christian Couder Signed-off-by: Junio C Hamano --- Documentation/githooks.txt | 302 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 302 insertions(+) create mode 100644 Documentation/githooks.txt (limited to 'Documentation/githooks.txt') diff --git a/Documentation/githooks.txt b/Documentation/githooks.txt new file mode 100644 index 0000000000..67c0809f72 --- /dev/null +++ b/Documentation/githooks.txt @@ -0,0 +1,302 @@ +githooks(5) +=========== + +NAME +---- +githooks - Hooks used by git + +SYNOPSIS +-------- +$GIT_DIR/hooks/* + + +DESCRIPTION +----------- + +Hooks are little scripts you can place in `$GIT_DIR/hooks` +directory to trigger action at certain points. When +`git-init` is run, a handful example hooks are copied in the +`hooks` directory of the new repository, but by default they are +all disabled. To enable a hook, make it executable with `chmod +x`. + +This document describes the currently defined hooks. + +applypatch-msg +-------------- + +This hook is invoked by `git-am` script. It takes a single +parameter, the name of the file that holds the proposed commit +log message. Exiting with non-zero status causes +`git-am` to abort before applying the patch. + +The hook is allowed to edit the message file in place, and can +be used to normalize the message into some project standard +format (if the project has one). It can also be used to refuse +the commit after inspecting the message file. + +The default 'applypatch-msg' hook, when enabled, runs the +'commit-msg' hook, if the latter is enabled. + +pre-applypatch +-------------- + +This hook is invoked by `git-am`. It takes no parameter, and is +invoked after the patch is applied, but before a commit is made. + +If it exits with non-zero status, then the working tree will not be +committed after applying the patch. + +It can be used to inspect the current working tree and refuse to +make a commit if it does not pass certain test. + +The default 'pre-applypatch' hook, when enabled, runs the +'pre-commit' hook, if the latter is enabled. + +post-applypatch +--------------- + +This hook is invoked by `git-am`. It takes no parameter, +and is invoked after the patch is applied and a commit is made. + +This hook is meant primarily for notification, and cannot affect +the outcome of `git-am`. + +pre-commit +---------- + +This hook is invoked by `git-commit`, and can be bypassed +with `\--no-verify` option. It takes no parameter, and is +invoked before obtaining the proposed commit log message and +making a commit. Exiting with non-zero status from this script +causes the `git-commit` to abort. + +The default 'pre-commit' hook, when enabled, catches introduction +of lines with trailing whitespaces and aborts the commit when +such a line is found. + +All the `git-commit` hooks are invoked with the environment +variable `GIT_EDITOR=:` if the command will not bring up an editor +to modify the commit message. + +prepare-commit-msg +------------------ + +This hook is invoked by `git-commit` right after preparing the +default log message, and before the editor is started. + +It takes one to three parameters. The first is the name of the file +that the commit log message. The second is the source of the commit +message, and can be: `message` (if a `\-m` or `\-F` option was +given); `template` (if a `\-t` option was given or the +configuration option `commit.template` is set); `merge` (if the +commit is a merge or a `.git/MERGE_MSG` file exists); `squash` +(if a `.git/SQUASH_MSG` file exists); or `commit`, followed by +a commit SHA1 (if a `\-c`, `\-C` or `\--amend` option was given). + +If the exit status is non-zero, `git-commit` will abort. + +The purpose of the hook is to edit the message file in place, and +it is not suppressed by the `\--no-verify` option. A non-zero exit +means a failure of the hook and aborts the commit. It should not +be used as replacement for pre-commit hook. + +The sample `prepare-commit-msg` hook that comes with git comments +out the `Conflicts:` part of a merge's commit message. + +commit-msg +---------- + +This hook is invoked by `git-commit`, and can be bypassed +with `\--no-verify` option. It takes a single parameter, the +name of the file that holds the proposed commit log message. +Exiting with non-zero status causes the `git-commit` to +abort. + +The hook is allowed to edit the message file in place, and can +be used to normalize the message into some project standard +format (if the project has one). It can also be used to refuse +the commit after inspecting the message file. + +The default 'commit-msg' hook, when enabled, detects duplicate +"Signed-off-by" lines, and aborts the commit if one is found. + +post-commit +----------- + +This hook is invoked by `git-commit`. It takes no +parameter, and is invoked after a commit is made. + +This hook is meant primarily for notification, and cannot affect +the outcome of `git-commit`. + +post-checkout +----------- + +This hook is invoked when a `git-checkout` is run after having updated the +worktree. The hook is given three parameters: the ref of the previous HEAD, +the ref of the new HEAD (which may or may not have changed), and a flag +indicating whether the checkout was a branch checkout (changing branches, +flag=1) or a file checkout (retrieving a file from the index, flag=0). +This hook cannot affect the outcome of `git-checkout`. + +This hook can be used to perform repository validity checks, auto-display +differences from the previous HEAD if different, or set working dir metadata +properties. + +post-merge +----------- + +This hook is invoked by `git-merge`, which happens when a `git pull` +is done on a local repository. The hook takes a single parameter, a status +flag specifying whether or not the merge being done was a squash merge. +This hook cannot affect the outcome of `git-merge`. + +This hook can be used in conjunction with a corresponding pre-commit hook to +save and restore any form of metadata associated with the working tree +(eg: permissions/ownership, ACLS, etc). See contrib/hooks/setgitperms.perl +for an example of how to do this. + +[[pre-receive]] +pre-receive +----------- + +This hook is invoked by `git-receive-pack` on the remote repository, +which happens when a `git push` is done on a local repository. +Just before starting to update refs on the remote repository, the +pre-receive hook is invoked. Its exit status determines the success +or failure of the update. + +This hook executes once for the receive operation. It takes no +arguments, but for each ref to be updated it receives on standard +input a line of the format: + + SP SP LF + +where `` is the old object name stored in the ref, +`` is the new object name to be stored in the ref and +`` is the full name of the ref. +When creating a new ref, `` is 40 `0`. + +If the hook exits with non-zero status, none of the refs will be +updated. If the hook exits with zero, updating of individual refs can +still be prevented by the <> hook. + +Both standard output and standard error output are forwarded to +`git-send-pack` on the other end, so you can simply `echo` messages +for the user. + +[[update]] +update +------ + +This hook is invoked by `git-receive-pack` on the remote repository, +which happens when a `git push` is done on a local repository. +Just before updating the ref on the remote repository, the update hook +is invoked. Its exit status determines the success or failure of +the ref update. + +The hook executes once for each ref to be updated, and takes +three parameters: + + - the name of the ref being updated, + - the old object name stored in the ref, + - and the new objectname to be stored in the ref. + +A zero exit from the update hook allows the ref to be updated. +Exiting with a non-zero status prevents `git-receive-pack` +from updating that ref. + +This hook can be used to prevent 'forced' update on certain refs by +making sure that the object name is a commit object that is a +descendant of the commit object named by the old object name. +That is, to enforce a "fast forward only" policy. + +It could also be used to log the old..new status. However, it +does not know the entire set of branches, so it would end up +firing one e-mail per ref when used naively, though. The +<> hook is more suited to that. + +Another use suggested on the mailing list is to use this hook to +implement access control which is finer grained than the one +based on filesystem group. + +Both standard output and standard error output are forwarded to +`git-send-pack` on the other end, so you can simply `echo` messages +for the user. + +The default 'update' hook, when enabled--and with +`hooks.allowunannotated` config option turned on--prevents +unannotated tags to be pushed. + +[[post-receive]] +post-receive +------------ + +This hook is invoked by `git-receive-pack` on the remote repository, +which happens when a `git push` is done on a local repository. +It executes on the remote repository once after all the refs have +been updated. + +This hook executes once for the receive operation. It takes no +arguments, but gets the same information as the +<> +hook does on its standard input. + +This hook does not affect the outcome of `git-receive-pack`, as it +is called after the real work is done. + +This supersedes the <> hook in that it gets +both old and new values of all the refs in addition to their +names. + +Both standard output and standard error output are forwarded to +`git-send-pack` on the other end, so you can simply `echo` messages +for the user. + +The default 'post-receive' hook is empty, but there is +a sample script `post-receive-email` provided in the `contrib/hooks` +directory in git distribution, which implements sending commit +emails. + +[[post-update]] +post-update +----------- + +This hook is invoked by `git-receive-pack` on the remote repository, +which happens when a `git push` is done on a local repository. +It executes on the remote repository once after all the refs have +been updated. + +It takes a variable number of parameters, each of which is the +name of ref that was actually updated. + +This hook is meant primarily for notification, and cannot affect +the outcome of `git-receive-pack`. + +The 'post-update' hook can tell what are the heads that were pushed, +but it does not know what their original and updated values are, +so it is a poor place to do log old..new. The +<> hook does get both original and +updated values of the refs. You might consider it instead if you need +them. + +When enabled, the default 'post-update' hook runs +`git-update-server-info` to keep the information used by dumb +transports (e.g., HTTP) up-to-date. If you are publishing +a git repository that is accessible via HTTP, you should +probably enable this hook. + +Both standard output and standard error output are forwarded to +`git-send-pack` on the other end, so you can simply `echo` messages +for the user. + +pre-auto-gc +----------- + +This hook is invoked by `git-gc --auto`. It takes no parameter, and +exiting with non-zero status from this script causes the `git-gc --auto` +to abort. + +GIT +--- +Part of the linkgit:git[7] suite -- cgit v1.2.3 From 9e1f0a85c68323830ea117092c55192b17aa3ac8 Mon Sep 17 00:00:00 2001 From: Christian Couder Date: Fri, 6 Jun 2008 09:07:32 +0200 Subject: documentation: move git(7) to git(1) As the "git" man page describes the "git" command at the end-user level, it seems better to move it to man section 1. Signed-off-by: Christian Couder Signed-off-by: Junio C Hamano --- Documentation/githooks.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Documentation/githooks.txt') diff --git a/Documentation/githooks.txt b/Documentation/githooks.txt index 53747febd2..4f06ae0ed4 100644 --- a/Documentation/githooks.txt +++ b/Documentation/githooks.txt @@ -300,4 +300,4 @@ to abort. GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite -- cgit v1.2.3 From f98f8cbac01e0d5dbb30660d7ea70af6a1439dfd Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 24 Jun 2008 18:45:21 -0700 Subject: Ship sample hooks with .sample suffix We used to mark hooks we ship as samples by making them unexecutable, but some filesystems cannot tell what is executable and what is not. This makes it much more explicit. The hooks are suffixed with .sample (but now are made executable), so enabling it is still one step operation (instead of "chmod +x $hook", you would do "mv $hook.sample $hook") but now they won't get accidentally enabled on systems without executable bit. Signed-off-by: Junio C Hamano --- Documentation/githooks.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Documentation/githooks.txt') diff --git a/Documentation/githooks.txt b/Documentation/githooks.txt index 4f06ae0ed4..262a4f1626 100644 --- a/Documentation/githooks.txt +++ b/Documentation/githooks.txt @@ -17,7 +17,8 @@ Hooks are little scripts you can place in `$GIT_DIR/hooks` directory to trigger action at certain points. When `git-init` is run, a handful example hooks are copied in the `hooks` directory of the new repository, but by default they are -all disabled. To enable a hook, make it executable with `chmod +x`. +all disabled. To enable a hook, rename it by removing its `.sample` +suffix. This document describes the currently defined hooks. -- cgit v1.2.3 From b1889c36d85514e5e70462294c561a02c2edfe2b Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Mon, 30 Jun 2008 01:09:04 -0500 Subject: Documentation: be consistent about "git-" versus "git " Since the git-* commands are not installed in $(bindir), using "git-command " in examples in the documentation is not a good idea. On the other hand, it is nice to be able to refer to each command using one hyphenated word. (There is no escaping it, anyway: man page names cannot have spaces in them.) This patch retains the dash in naming an operation, command, program, process, or action. Complete command lines that can be entered at a shell (i.e., without options omitted) are made to use the dashless form. The changes consist only of replacing some spaces with hyphens and vice versa. After a "s/ /-/g", the unpatched and patched versions are identical. Signed-off-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- Documentation/githooks.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Documentation/githooks.txt') diff --git a/Documentation/githooks.txt b/Documentation/githooks.txt index 262a4f1626..6a0d098f7c 100644 --- a/Documentation/githooks.txt +++ b/Documentation/githooks.txt @@ -147,7 +147,7 @@ properties. post-merge ----------- -This hook is invoked by `git-merge`, which happens when a `git pull` +This hook is invoked by `git-merge`, which happens when a `git-pull` is done on a local repository. The hook takes a single parameter, a status flag specifying whether or not the merge being done was a squash merge. This hook cannot affect the outcome of `git-merge` and is not executed, @@ -163,7 +163,7 @@ pre-receive ----------- This hook is invoked by `git-receive-pack` on the remote repository, -which happens when a `git push` is done on a local repository. +which happens when a `git-push` is done on a local repository. Just before starting to update refs on the remote repository, the pre-receive hook is invoked. Its exit status determines the success or failure of the update. @@ -192,7 +192,7 @@ update ------ This hook is invoked by `git-receive-pack` on the remote repository, -which happens when a `git push` is done on a local repository. +which happens when a `git-push` is done on a local repository. Just before updating the ref on the remote repository, the update hook is invoked. Its exit status determines the success or failure of the ref update. @@ -235,7 +235,7 @@ post-receive ------------ This hook is invoked by `git-receive-pack` on the remote repository, -which happens when a `git push` is done on a local repository. +which happens when a `git-push` is done on a local repository. It executes on the remote repository once after all the refs have been updated. @@ -265,7 +265,7 @@ post-update ----------- This hook is invoked by `git-receive-pack` on the remote repository, -which happens when a `git push` is done on a local repository. +which happens when a `git-push` is done on a local repository. It executes on the remote repository once after all the refs have been updated. -- cgit v1.2.3 From ba020ef5eb5fca3d757bd580ff117adaf81ca079 Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Thu, 3 Jul 2008 00:41:41 -0500 Subject: manpages: italicize git command names (which were in teletype font) The names of git commands are not meant to be entered at the commandline; they are just names. So we render them in italics, as is usual for command names in manpages. Using doit () { perl -e 'for (<>) { s/\`(git-[^\`.]*)\`/'\''\1'\''/g; print }' } for i in git*.txt config.txt diff*.txt blame*.txt fetch*.txt i18n.txt \ merge*.txt pretty*.txt pull*.txt rev*.txt urls*.txt do doit <"$i" >"$i+" && mv "$i+" "$i" done git diff . Signed-off-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- Documentation/githooks.txt | 74 +++++++++++++++++++++++----------------------- 1 file changed, 37 insertions(+), 37 deletions(-) (limited to 'Documentation/githooks.txt') diff --git a/Documentation/githooks.txt b/Documentation/githooks.txt index 6a0d098f7c..046a2a7fe7 100644 --- a/Documentation/githooks.txt +++ b/Documentation/githooks.txt @@ -15,7 +15,7 @@ DESCRIPTION Hooks are little scripts you can place in `$GIT_DIR/hooks` directory to trigger action at certain points. When -`git-init` is run, a handful example hooks are copied in the +'git-init' is run, a handful example hooks are copied in the `hooks` directory of the new repository, but by default they are all disabled. To enable a hook, rename it by removing its `.sample` suffix. @@ -25,10 +25,10 @@ This document describes the currently defined hooks. applypatch-msg -------------- -This hook is invoked by `git-am` script. It takes a single +This hook is invoked by 'git-am' script. It takes a single parameter, the name of the file that holds the proposed commit log message. Exiting with non-zero status causes -`git-am` to abort before applying the patch. +'git-am' to abort before applying the patch. The hook is allowed to edit the message file in place, and can be used to normalize the message into some project standard @@ -41,7 +41,7 @@ The default 'applypatch-msg' hook, when enabled, runs the pre-applypatch -------------- -This hook is invoked by `git-am`. It takes no parameter, and is +This hook is invoked by 'git-am'. It takes no parameter, and is invoked after the patch is applied, but before a commit is made. If it exits with non-zero status, then the working tree will not be @@ -56,33 +56,33 @@ The default 'pre-applypatch' hook, when enabled, runs the post-applypatch --------------- -This hook is invoked by `git-am`. It takes no parameter, +This hook is invoked by 'git-am'. It takes no parameter, and is invoked after the patch is applied and a commit is made. This hook is meant primarily for notification, and cannot affect -the outcome of `git-am`. +the outcome of 'git-am'. pre-commit ---------- -This hook is invoked by `git-commit`, and can be bypassed +This hook is invoked by 'git-commit', and can be bypassed with `\--no-verify` option. It takes no parameter, and is invoked before obtaining the proposed commit log message and making a commit. Exiting with non-zero status from this script -causes the `git-commit` to abort. +causes the 'git-commit' to abort. The default 'pre-commit' hook, when enabled, catches introduction of lines with trailing whitespaces and aborts the commit when such a line is found. -All the `git-commit` hooks are invoked with the environment +All the 'git-commit' hooks are invoked with the environment variable `GIT_EDITOR=:` if the command will not bring up an editor to modify the commit message. prepare-commit-msg ------------------ -This hook is invoked by `git-commit` right after preparing the +This hook is invoked by 'git-commit' right after preparing the default log message, and before the editor is started. It takes one to three parameters. The first is the name of the file @@ -94,7 +94,7 @@ commit is a merge or a `.git/MERGE_MSG` file exists); `squash` (if a `.git/SQUASH_MSG` file exists); or `commit`, followed by a commit SHA1 (if a `\-c`, `\-C` or `\--amend` option was given). -If the exit status is non-zero, `git-commit` will abort. +If the exit status is non-zero, 'git-commit' will abort. The purpose of the hook is to edit the message file in place, and it is not suppressed by the `\--no-verify` option. A non-zero exit @@ -107,10 +107,10 @@ out the `Conflicts:` part of a merge's commit message. commit-msg ---------- -This hook is invoked by `git-commit`, and can be bypassed +This hook is invoked by 'git-commit', and can be bypassed with `\--no-verify` option. It takes a single parameter, the name of the file that holds the proposed commit log message. -Exiting with non-zero status causes the `git-commit` to +Exiting with non-zero status causes the 'git-commit' to abort. The hook is allowed to edit the message file in place, and can @@ -124,21 +124,21 @@ The default 'commit-msg' hook, when enabled, detects duplicate post-commit ----------- -This hook is invoked by `git-commit`. It takes no +This hook is invoked by 'git-commit'. It takes no parameter, and is invoked after a commit is made. This hook is meant primarily for notification, and cannot affect -the outcome of `git-commit`. +the outcome of 'git-commit'. post-checkout ----------- -This hook is invoked when a `git-checkout` is run after having updated the +This hook is invoked when a 'git-checkout' is run after having updated the worktree. The hook is given three parameters: the ref of the previous HEAD, the ref of the new HEAD (which may or may not have changed), and a flag indicating whether the checkout was a branch checkout (changing branches, flag=1) or a file checkout (retrieving a file from the index, flag=0). -This hook cannot affect the outcome of `git-checkout`. +This hook cannot affect the outcome of 'git-checkout'. This hook can be used to perform repository validity checks, auto-display differences from the previous HEAD if different, or set working dir metadata @@ -147,10 +147,10 @@ properties. post-merge ----------- -This hook is invoked by `git-merge`, which happens when a `git-pull` +This hook is invoked by 'git-merge', which happens when a 'git-pull' is done on a local repository. The hook takes a single parameter, a status flag specifying whether or not the merge being done was a squash merge. -This hook cannot affect the outcome of `git-merge` and is not executed, +This hook cannot affect the outcome of 'git-merge' and is not executed, if the merge failed due to conflicts. This hook can be used in conjunction with a corresponding pre-commit hook to @@ -162,8 +162,8 @@ for an example of how to do this. pre-receive ----------- -This hook is invoked by `git-receive-pack` on the remote repository, -which happens when a `git-push` is done on a local repository. +This hook is invoked by 'git-receive-pack' on the remote repository, +which happens when a 'git-push' is done on a local repository. Just before starting to update refs on the remote repository, the pre-receive hook is invoked. Its exit status determines the success or failure of the update. @@ -184,15 +184,15 @@ updated. If the hook exits with zero, updating of individual refs can still be prevented by the <> hook. Both standard output and standard error output are forwarded to -`git-send-pack` on the other end, so you can simply `echo` messages +'git-send-pack' on the other end, so you can simply `echo` messages for the user. [[update]] update ------ -This hook is invoked by `git-receive-pack` on the remote repository, -which happens when a `git-push` is done on a local repository. +This hook is invoked by 'git-receive-pack' on the remote repository, +which happens when a 'git-push' is done on a local repository. Just before updating the ref on the remote repository, the update hook is invoked. Its exit status determines the success or failure of the ref update. @@ -205,7 +205,7 @@ three parameters: - and the new objectname to be stored in the ref. A zero exit from the update hook allows the ref to be updated. -Exiting with a non-zero status prevents `git-receive-pack` +Exiting with a non-zero status prevents 'git-receive-pack' from updating that ref. This hook can be used to prevent 'forced' update on certain refs by @@ -223,7 +223,7 @@ implement access control which is finer grained than the one based on filesystem group. Both standard output and standard error output are forwarded to -`git-send-pack` on the other end, so you can simply `echo` messages +'git-send-pack' on the other end, so you can simply `echo` messages for the user. The default 'update' hook, when enabled--and with @@ -234,8 +234,8 @@ unannotated tags to be pushed. post-receive ------------ -This hook is invoked by `git-receive-pack` on the remote repository, -which happens when a `git-push` is done on a local repository. +This hook is invoked by 'git-receive-pack' on the remote repository, +which happens when a 'git-push' is done on a local repository. It executes on the remote repository once after all the refs have been updated. @@ -244,7 +244,7 @@ arguments, but gets the same information as the <> hook does on its standard input. -This hook does not affect the outcome of `git-receive-pack`, as it +This hook does not affect the outcome of 'git-receive-pack', as it is called after the real work is done. This supersedes the <> hook in that it gets @@ -252,7 +252,7 @@ both old and new values of all the refs in addition to their names. Both standard output and standard error output are forwarded to -`git-send-pack` on the other end, so you can simply `echo` messages +'git-send-pack' on the other end, so you can simply `echo` messages for the user. The default 'post-receive' hook is empty, but there is @@ -264,8 +264,8 @@ emails. post-update ----------- -This hook is invoked by `git-receive-pack` on the remote repository, -which happens when a `git-push` is done on a local repository. +This hook is invoked by 'git-receive-pack' on the remote repository, +which happens when a 'git-push' is done on a local repository. It executes on the remote repository once after all the refs have been updated. @@ -273,7 +273,7 @@ It takes a variable number of parameters, each of which is the name of ref that was actually updated. This hook is meant primarily for notification, and cannot affect -the outcome of `git-receive-pack`. +the outcome of 'git-receive-pack'. The 'post-update' hook can tell what are the heads that were pushed, but it does not know what their original and updated values are, @@ -283,20 +283,20 @@ updated values of the refs. You might consider it instead if you need them. When enabled, the default 'post-update' hook runs -`git-update-server-info` to keep the information used by dumb +'git-update-server-info' to keep the information used by dumb transports (e.g., HTTP) up-to-date. If you are publishing a git repository that is accessible via HTTP, you should probably enable this hook. Both standard output and standard error output are forwarded to -`git-send-pack` on the other end, so you can simply `echo` messages +'git-send-pack' on the other end, so you can simply `echo` messages for the user. pre-auto-gc ----------- -This hook is invoked by `git-gc --auto`. It takes no parameter, and -exiting with non-zero status from this script causes the `git-gc --auto` +This hook is invoked by 'git-gc --auto'. It takes no parameter, and +exiting with non-zero status from this script causes the 'git-gc --auto' to abort. GIT -- cgit v1.2.3 From 5d6b3a9ef80a8bcd77b57ea14d4284b022b95a1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?SZEDER=20G=C3=A1bor?= Date: Tue, 30 Sep 2008 19:27:10 +0200 Subject: Documentation: remove '\' in front of short options MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... because they show up in the man and html outputs. This escaping is only needed for double dashes to be compatible with older asciidoc versions; see commit e1ccf53 ([PATCH] Escape asciidoc's built-in em-dash replacement, 2005-09-12). Signed-off-by: SZEDER Gábor Signed-off-by: Shawn O. Pearce --- Documentation/githooks.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Documentation/githooks.txt') diff --git a/Documentation/githooks.txt b/Documentation/githooks.txt index 046a2a7fe7..7fefdb1f45 100644 --- a/Documentation/githooks.txt +++ b/Documentation/githooks.txt @@ -87,12 +87,12 @@ default log message, and before the editor is started. It takes one to three parameters. The first is the name of the file that the commit log message. The second is the source of the commit -message, and can be: `message` (if a `\-m` or `\-F` option was -given); `template` (if a `\-t` option was given or the +message, and can be: `message` (if a `-m` or `-F` option was +given); `template` (if a `-t` option was given or the configuration option `commit.template` is set); `merge` (if the commit is a merge or a `.git/MERGE_MSG` file exists); `squash` (if a `.git/SQUASH_MSG` file exists); or `commit`, followed by -a commit SHA1 (if a `\-c`, `\-C` or `\--amend` option was given). +a commit SHA1 (if a `-c`, `-C` or `\--amend` option was given). If the exit status is non-zero, 'git-commit' will abort. -- cgit v1.2.3 From 00e5d48a9aef3228496d6f517a272fa095c562fe Mon Sep 17 00:00:00 2001 From: Nanako Shiraishi Date: Sun, 5 Oct 2008 22:26:54 +0900 Subject: docs: describe pre-rebase hook Documentation/git-rebase.txt talks about pre-rebase hook, but it appears that Documentation/git-hooks.txt does not have corresponding entry for it. Signed-off-by: Nanako Shiraishi Signed-off-by: Shawn O. Pearce --- Documentation/githooks.txt | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Documentation/githooks.txt') diff --git a/Documentation/githooks.txt b/Documentation/githooks.txt index 7fefdb1f45..5faaaa5fed 100644 --- a/Documentation/githooks.txt +++ b/Documentation/githooks.txt @@ -130,6 +130,13 @@ parameter, and is invoked after a commit is made. This hook is meant primarily for notification, and cannot affect the outcome of 'git-commit'. +pre-rebase +---------- + +This hook is called by 'git-rebase' and can be used to prevent a branch +from getting rebased. + + post-checkout ----------- -- cgit v1.2.3 From 1df27132493171294d0d2b53bd75bb8e131eea2b Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Wed, 17 Dec 2008 22:29:06 +0100 Subject: githooks documentation: add a note about the +x mode In a freshly initialized repo it is only necessary to rename the .sample hooks, but when using older repos (initialized with older git init) enabled the +x mode is still necessary - docuement this. Signed-off-by: Miklos Vajna Signed-off-by: Junio C Hamano --- Documentation/githooks.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Documentation/githooks.txt') diff --git a/Documentation/githooks.txt b/Documentation/githooks.txt index 5faaaa5fed..cfdae1efa2 100644 --- a/Documentation/githooks.txt +++ b/Documentation/githooks.txt @@ -20,6 +20,10 @@ directory to trigger action at certain points. When all disabled. To enable a hook, rename it by removing its `.sample` suffix. +NOTE: It is also a requirement for a given hook to be executable. +However - in a freshly initialized repository - the `.sample` files are +executable by default. + This document describes the currently defined hooks. applypatch-msg -- cgit v1.2.3 From 323b9db839cc4e49008666e402aac3264e359423 Mon Sep 17 00:00:00 2001 From: Jon Loeliger Date: Mon, 12 Jan 2009 14:02:07 -0600 Subject: Fix Documentation typos surrounding the word 'handful'. Some instances replaced by "handful of", others use the word "few", a couple get a slight rewording. Signed-off-by: Jon Loeliger Signed-off-by: Junio C Hamano --- Documentation/githooks.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Documentation/githooks.txt') diff --git a/Documentation/githooks.txt b/Documentation/githooks.txt index cfdae1efa2..e4d61d5562 100644 --- a/Documentation/githooks.txt +++ b/Documentation/githooks.txt @@ -15,7 +15,7 @@ DESCRIPTION Hooks are little scripts you can place in `$GIT_DIR/hooks` directory to trigger action at certain points. When -'git-init' is run, a handful example hooks are copied in the +'git-init' is run, a handful of example hooks are copied into the `hooks` directory of the new repository, but by default they are all disabled. To enable a hook, rename it by removing its `.sample` suffix. -- cgit v1.2.3 From 996869601594ffefb67238175055922340ced6f8 Mon Sep 17 00:00:00 2001 From: Stephan Beyer Date: Fri, 16 Jan 2009 21:36:06 +0100 Subject: githooks.txt: add missing word Signed-off-by: Stephan Beyer Signed-off-by: Junio C Hamano --- Documentation/githooks.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Documentation/githooks.txt') diff --git a/Documentation/githooks.txt b/Documentation/githooks.txt index 5faaaa5fed..024abb2ff1 100644 --- a/Documentation/githooks.txt +++ b/Documentation/githooks.txt @@ -86,7 +86,7 @@ This hook is invoked by 'git-commit' right after preparing the default log message, and before the editor is started. It takes one to three parameters. The first is the name of the file -that the commit log message. The second is the source of the commit +that contains the commit log message. The second is the source of the commit message, and can be: `message` (if a `-m` or `-F` option was given); `template` (if a `-t` option was given or the configuration option `commit.template` is set); `merge` (if the -- cgit v1.2.3 From 24c11552cb3bd7ec343c8061c87b07aa7abbad00 Mon Sep 17 00:00:00 2001 From: Jens Lehmann Date: Sun, 22 Mar 2009 19:46:38 +0100 Subject: githooks documentation: post-checkout hook is also called after clone The documentation of the post-checkout hook just talks about git-checkout. But recently git-clone was changed to call it too, unless the -no-checkout (-n) option is used. Signed-off-by: Jens Lehmann Signed-off-by: Junio C Hamano --- Documentation/githooks.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Documentation/githooks.txt') diff --git a/Documentation/githooks.txt b/Documentation/githooks.txt index 1fd512bca2..1c736738cc 100644 --- a/Documentation/githooks.txt +++ b/Documentation/githooks.txt @@ -151,6 +151,10 @@ indicating whether the checkout was a branch checkout (changing branches, flag=1) or a file checkout (retrieving a file from the index, flag=0). This hook cannot affect the outcome of 'git-checkout'. +It is also run after 'git-clone', unless the --no-checkout (-n) option is +used. The first parameter given to the hook is the null-ref, the second the +ref of the new HEAD and the flag is always 1. + This hook can be used to perform repository validity checks, auto-display differences from the previous HEAD if different, or set working dir metadata properties. -- cgit v1.2.3