git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Documentation: fix description for enabling hooks
@ 2008-12-17  2:59 Markus Heidelberg
  2008-12-17  4:13 ` Miklos Vajna
  0 siblings, 1 reply; 6+ messages in thread
From: Markus Heidelberg @ 2008-12-17  2:59 UTC (permalink / raw)
  To: gitster; +Cc: git

Since f98f8cb (Ship sample hooks with .sample suffix, 2008-06-24) hooks
are not enabled by making them executable anymore, but by removing the
'.sample' suffix from the filename.

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
---
 Documentation/gitrepository-layout.txt |    3 ++-
 Documentation/glossary-content.txt     |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/Documentation/gitrepository-layout.txt b/Documentation/gitrepository-layout.txt
index a969b3f..1befca9 100644
--- a/Documentation/gitrepository-layout.txt
+++ b/Documentation/gitrepository-layout.txt
@@ -134,7 +134,8 @@ hooks::
 	Hooks are customization scripts used by various git
 	commands.  A handful of sample hooks are installed when
 	'git-init' is run, but all of them are disabled by
-	default.  To enable, they need to be made executable.
+	default.  To enable, the `.sample` suffix has to be
+	removed from the filename by renaming.
 	Read linkgit:githooks[5] for more details about
 	each hook.
 
diff --git a/Documentation/glossary-content.txt b/Documentation/glossary-content.txt
index 9b4a4f4..9afca75 100644
--- a/Documentation/glossary-content.txt
+++ b/Documentation/glossary-content.txt
@@ -183,7 +183,8 @@ to point at the new commit.
 	and potentially aborted, and allow for a post-notification after the
 	operation is done. The hook scripts are found in the
 	`$GIT_DIR/hooks/` directory, and are enabled by simply
-	making them executable.
+	removing the `.sample` suffix from the filename. In earlier versions
+	of git you had to make them executable.
 
 [[def_index]]index::
 	A collection of files with stat information, whose contents are stored
-- 
1.6.1.rc3.23.gaf48b

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] Documentation: fix description for enabling hooks
  2008-12-17  2:59 [PATCH] Documentation: fix description for enabling hooks Markus Heidelberg
@ 2008-12-17  4:13 ` Miklos Vajna
  2008-12-17  7:44   ` Johannes Sixt
  0 siblings, 1 reply; 6+ messages in thread
From: Miklos Vajna @ 2008-12-17  4:13 UTC (permalink / raw)
  To: Markus Heidelberg; +Cc: gitster, git

[-- Attachment #1: Type: text/plain, Size: 449 bytes --]

On Wed, Dec 17, 2008 at 03:59:23AM +0100, Markus Heidelberg <markus.heidelberg@web.de> wrote:
> Since f98f8cb (Ship sample hooks with .sample suffix, 2008-06-24) hooks
> are not enabled by making them executable anymore, but by removing the
> '.sample' suffix from the filename.

This is true, but having the executable bit is necessary as well. I
think it would be better to just append this requirement instead of
replacing the old one with this.

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Documentation: fix description for enabling hooks
  2008-12-17  4:13 ` Miklos Vajna
@ 2008-12-17  7:44   ` Johannes Sixt
  2008-12-17 14:36     ` Miklos Vajna
  0 siblings, 1 reply; 6+ messages in thread
From: Johannes Sixt @ 2008-12-17  7:44 UTC (permalink / raw)
  To: Miklos Vajna; +Cc: Markus Heidelberg, gitster, git

Miklos Vajna schrieb:
> On Wed, Dec 17, 2008 at 03:59:23AM +0100, Markus Heidelberg <markus.heidelberg@web.de> wrote:
>> Since f98f8cb (Ship sample hooks with .sample suffix, 2008-06-24) hooks
>> are not enabled by making them executable anymore, but by removing the
>> '.sample' suffix from the filename.
> 
> This is true, but having the executable bit is necessary as well. I
> think it would be better to just append this requirement instead of
> replacing the old one with this.

Markus's proposed new wording is correct because the .sample hooks *are*
already executable.

-- Hannes

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Documentation: fix description for enabling hooks
  2008-12-17  7:44   ` Johannes Sixt
@ 2008-12-17 14:36     ` Miklos Vajna
  2008-12-17 19:55       ` Markus Heidelberg
  0 siblings, 1 reply; 6+ messages in thread
From: Miklos Vajna @ 2008-12-17 14:36 UTC (permalink / raw)
  To: Johannes Sixt; +Cc: Markus Heidelberg, gitster, git

[-- Attachment #1: Type: text/plain, Size: 673 bytes --]

On Wed, Dec 17, 2008 at 08:44:40AM +0100, Johannes Sixt <j.sixt@viscovery.net> wrote:
> > This is true, but having the executable bit is necessary as well. I
> > think it would be better to just append this requirement instead of
> > replacing the old one with this.
> 
> Markus's proposed new wording is correct because the .sample hooks *are*
> already executable.

I thought about the following situation: The user reads the
documentation while working in an older repo (initialized a few versions
ago). S/he sees that the .sample suffix is already missing, so s/he
assumes that the hook is already active. Which is not true, because the
+x bit is missing.

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Documentation: fix description for enabling hooks
  2008-12-17 14:36     ` Miklos Vajna
@ 2008-12-17 19:55       ` Markus Heidelberg
  2008-12-17 21:29         ` [PATCH] githooks documentation: add a note about the +x mode Miklos Vajna
  0 siblings, 1 reply; 6+ messages in thread
From: Markus Heidelberg @ 2008-12-17 19:55 UTC (permalink / raw)
  To: Miklos Vajna; +Cc: Johannes Sixt, gitster, git

Miklos Vajna, 17.12.2008:
> On Wed, Dec 17, 2008 at 08:44:40AM +0100, Johannes Sixt <j.sixt@viscovery.net> wrote:
> > > This is true, but having the executable bit is necessary as well. I
> > > think it would be better to just append this requirement instead of
> > > replacing the old one with this.
> > 
> > Markus's proposed new wording is correct because the .sample hooks *are*
> > already executable.
> 
> I thought about the following situation: The user reads the
> documentation while working in an older repo (initialized a few versions
> ago). S/he sees that the .sample suffix is already missing, so s/he
> assumes that the hook is already active. Which is not true, because the
> +x bit is missing.

Valid point, I think, but not critical in this case, since the patch
only affected gitrepository-layout(5) and gitglossary(7).

When you want to learn how to use hooks, you will probably rather read
githooks(5), where the need for the executable bit is not even
explicitly mentioned. Maybe it should be added there?

Markus

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] githooks documentation: add a note about the +x mode
  2008-12-17 19:55       ` Markus Heidelberg
@ 2008-12-17 21:29         ` Miklos Vajna
  0 siblings, 0 replies; 6+ messages in thread
From: Miklos Vajna @ 2008-12-17 21:29 UTC (permalink / raw)
  To: gitster; +Cc: Johannes Sixt, Markus Heidelberg, git

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 <vmiklos@frugalware.org>
---

On Wed, Dec 17, 2008 at 08:55:45PM +0100, Markus Heidelberg <markus.heidelberg@web.de> wrote:
> When you want to learn how to use hooks, you will probably rather read
> githooks(5), where the need for the executable bit is not even
> explicitly mentioned. Maybe it should be added there?

I think so.

 Documentation/githooks.txt |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/Documentation/githooks.txt b/Documentation/githooks.txt
index 5faaaa5..cfdae1e 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
-- 
1.6.1.rc1.35.gae26e.dirty

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-12-17 21:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-17  2:59 [PATCH] Documentation: fix description for enabling hooks Markus Heidelberg
2008-12-17  4:13 ` Miklos Vajna
2008-12-17  7:44   ` Johannes Sixt
2008-12-17 14:36     ` Miklos Vajna
2008-12-17 19:55       ` Markus Heidelberg
2008-12-17 21:29         ` [PATCH] githooks documentation: add a note about the +x mode Miklos Vajna

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).