threads / patch / 28498

patch, 2 partstemplates/hooks--*: don't refer to contrib hooks

Subject: [PATCH 2/2] templates/hooks--*: don't refer to contrib hooks

## tl;dr

3 messages between Sep 26, 2011 and Sep 27, 2011. Diffs are folded; open one to read it.

replies: 2people: 2as markdown or json

Gerrit Pape· Sep 26, 2011, 12:59 UTC · lore

Simplify the sample post-receive hook to not refer to some location of a contrib hook that might be installed in different locations on different systems. Instead simply provide a sample file that does nothing just as the post-commit sample hook.

Signed-off-by: Gerrit Pape <pape@smarden.org>
---
 templates/hooks--post-receive.sample |   12 ++----------
 1 files changed, 2 insertions(+), 10 deletions(-)
Show changes to templates/hooks--post-receive.sample +2 −10
diff --git a/templates/hooks--post-receive.sample b/templates/hooks--post-receive.sample
index 7a83e17..5b1771f 100755
--- a/templates/hooks--post-receive.sample
+++ b/templates/hooks--post-receive.sample
@@ -2,14 +2,6 @@
 #
 # An example hook script for the "post-receive" event.
 #
-# The "post-receive" script is run after receive-pack has accepted a pack
-# and the repository has been updated.  It is passed arguments in through
-# stdin in the form
-#  <oldrev> <newrev> <refname>
-# For example:
-#  aa453216d1b3e49e7f6f98441fa56946ddcd6a20 68f7abf4e6f922807889f52bc043ecd31b79f814 refs/heads/master
-#
-# see contrib/hooks/ for a sample, or uncomment the next line and
-# rename the file to "post-receive".
+# To enable this hook, rename this file to "post-receive".
 
-#. /usr/share/doc/git-core/contrib/hooks/post-receive-email
+: Nothing
-- 
1.7.6.3
Junio C Hamano· Sep 26, 2011, 17:52 UTC · re: Gerrit Pape · lore

Re: [PATCH 2/2] templates/hooks--*: don't refer to contrib hooks

Gerrit Pape <pape@smarden.org> writes:
Show 21 quoted lines
> Simplify the sample post-receive hook to not refer to some location of a
> contrib hook that might be installed in different locations on different
> systems.  Instead simply provide a sample file that does nothing just as
> the post-commit sample hook.
>
> Signed-off-by: Gerrit Pape <pape@smarden.org>
> ---
>  templates/hooks--post-receive.sample |   12 ++----------
>  1 files changed, 2 insertions(+), 10 deletions(-)
>
> diff --git a/templates/hooks--post-receive.sample b/templates/hooks--post-receive.sample
> index 7a83e17..5b1771f 100755
> --- a/templates/hooks--post-receive.sample
> +++ b/templates/hooks--post-receive.sample
> @@ -2,14 +2,6 @@
>  #
>  # An example hook script for the "post-receive" event.
>  #
> +# To enable this hook, rename this file to "post-receive".
>  
> +: Nothing

I removed the "-" lines above. Looking at the result, I really have to wonder if it makes much sense to keep the file here. It is not even an example anymore, and the user does not gain anything by enabling it, following the suggestion.

Let's instead remove the file altogether, Ok?
Gerrit Pape· Sep 27, 2011, 11:56 UTC · re: Junio C Hamano · lore

[PATCH] templates/hooks--*: remove sample hooks without any functionality

Remove the sample post-commit and post-receive hooks. The sample post-commit doesn't contain any sample functionality and the comments do not provide more information than already found in the documentation. The sample post-receive hooks doesn't provide any sample functionality either and refers in the comments to a contrib hook that might be installed in different locations on different systems, which isn't that helpful.

Signed-off-by: Gerrit Pape <pape@smarden.org>
---
On Mon, Sep 26, 2011 at 10:52:23AM -0700, Junio C Hamano wrote:
Show 6 quoted lines
> I removed the "-" lines above. Looking at the result, I really have to
> wonder if it makes much sense to keep the file here. It is not even an
> example anymore, and the user does not gain anything by enabling it,
> following the suggestion.
>
> Let's instead remove the file altogether, Ok?

Fine with me. As the same applies to the sample post-commit hook, I made this patch to remove both of them.

Thanks for your patience, Gerrit.
 templates/hooks--post-commit.sample  |    8 --------
 templates/hooks--post-receive.sample |   15 ---------------
 2 files changed, 0 insertions(+), 23 deletions(-)
 delete mode 100755 templates/hooks--post-commit.sample
 delete mode 100755 templates/hooks--post-receive.sample
Show changes to 2 files +0 −23

templates/hooks--post-commit.sample, templates/hooks--post-receive.sample

diff --git a/templates/hooks--post-commit.sample b/templates/hooks--post-commit.sample
deleted file mode 100755
index 2266821..0000000
--- a/templates/hooks--post-commit.sample
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-#
-# An example hook script that is called after a successful
-# commit is made.
-#
-# To enable this hook, rename this file to "post-commit".
-
-: Nothing
diff --git a/templates/hooks--post-receive.sample b/templates/hooks--post-receive.sample
deleted file mode 100755
index 7a83e17..0000000
--- a/templates/hooks--post-receive.sample
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh
-#
-# An example hook script for the "post-receive" event.
-#
-# The "post-receive" script is run after receive-pack has accepted a pack
-# and the repository has been updated.  It is passed arguments in through
-# stdin in the form
-#  <oldrev> <newrev> <refname>
-# For example:
-#  aa453216d1b3e49e7f6f98441fa56946ddcd6a20 68f7abf4e6f922807889f52bc043ecd31b79f814 refs/heads/master
-#
-# see contrib/hooks/ for a sample, or uncomment the next line and
-# rename the file to "post-receive".
-
-#. /usr/share/doc/git-core/contrib/hooks/post-receive-email
-- 
1.7.6.3

← back to recent threads