Git development
 help / color / mirror / Atom feed
* [PATCH 0/4] doc: hook: small improvements
@ 2026-05-21 16:25 kristofferhaugsbakk
  2026-05-21 16:25 ` [PATCH 1/4] doc: hook: remove stray backtick kristofferhaugsbakk
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: kristofferhaugsbakk @ 2026-05-21 16:25 UTC (permalink / raw)
  To: git; +Cc: Kristoffer Haugsbakk, jn.avila, adrian.ratiu

From: Kristoffer Haugsbakk <code@khaugsbakk.name>

Topic name: kh/doc-hook

Topic summary: Small improvements to git-hook(1) and the associated config.

[1/4] doc: hook: remove stray backtick
[2/4] doc: hook: consistently capitalize Git
[3/4] doc: config: include existing git-hook(1) section
[4/4] doc: hook: don’t self-link via config include

 Documentation/config.adoc      |  2 ++
 Documentation/config/hook.adoc | 19 +++++++++++++------
 Documentation/git-hook.adoc    | 11 ++++++-----
 3 files changed, 21 insertions(+), 11 deletions(-)


base-commit: aec3f587505a472db67e9462d0702e7d463a449d
-- 
2.54.0.13.g9c7419e39f8


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

* [PATCH 1/4] doc: hook: remove stray backtick
  2026-05-21 16:25 [PATCH 0/4] doc: hook: small improvements kristofferhaugsbakk
@ 2026-05-21 16:25 ` kristofferhaugsbakk
  2026-05-21 16:25 ` [PATCH 2/4] doc: hook: consistently capitalize Git kristofferhaugsbakk
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: kristofferhaugsbakk @ 2026-05-21 16:25 UTC (permalink / raw)
  To: git; +Cc: Kristoffer Haugsbakk, jn.avila, adrian.ratiu

From: Kristoffer Haugsbakk <code@khaugsbakk.name>

Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
---
 Documentation/git-hook.adoc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/git-hook.adoc b/Documentation/git-hook.adoc
index 46ea52db55f..96c5c9c3c23 100644
--- a/Documentation/git-hook.adoc
+++ b/Documentation/git-hook.adoc
@@ -41,7 +41,7 @@ spell-checker for your commit messages, you would write a configuration like so:
 
 With this config, when you run 'git commit', first `~/bin/linter --cpp20` will
 have a chance to check your files to be committed (during the `pre-commit` hook
-event`), and then `~/bin/spellchecker` will have a chance to check your commit
+event), and then `~/bin/spellchecker` will have a chance to check your commit
 message (during the `commit-msg` hook event).
 
 Commands are run in the order Git encounters their associated
-- 
2.54.0.13.g9c7419e39f8


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

* [PATCH 2/4] doc: hook: consistently capitalize Git
  2026-05-21 16:25 [PATCH 0/4] doc: hook: small improvements kristofferhaugsbakk
  2026-05-21 16:25 ` [PATCH 1/4] doc: hook: remove stray backtick kristofferhaugsbakk
@ 2026-05-21 16:25 ` kristofferhaugsbakk
  2026-05-21 16:25 ` [PATCH 3/4] doc: config: include existing git-hook(1) section kristofferhaugsbakk
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: kristofferhaugsbakk @ 2026-05-21 16:25 UTC (permalink / raw)
  To: git; +Cc: Kristoffer Haugsbakk, jn.avila, adrian.ratiu

From: Kristoffer Haugsbakk <code@khaugsbakk.name>

Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
---
 Documentation/git-hook.adoc | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Documentation/git-hook.adoc b/Documentation/git-hook.adoc
index 96c5c9c3c23..750df58e58e 100644
--- a/Documentation/git-hook.adoc
+++ b/Documentation/git-hook.adoc
@@ -3,7 +3,7 @@ git-hook(1)
 
 NAME
 ----
-git-hook - Run git hooks
+git-hook - Run Git hooks
 
 SYNOPSIS
 --------
@@ -15,8 +15,8 @@ SYNOPSIS
 DESCRIPTION
 -----------
 
-A command interface for running git hooks (see linkgit:githooks[5]),
-for use by other scripted git commands.
+A command interface for running Git hooks (see linkgit:githooks[5]),
+for use by other scripted Git commands.
 
 This command parses the default configuration files for sets of configs like
 so:
@@ -161,7 +161,7 @@ setting, allowing all hooks for the event to run concurrently, even if they
 are not individually marked as parallel.
 +
 Some hooks always run sequentially regardless of this flag or the
-`hook.jobs` config, because git knows they cannot safely run in parallel:
+`hook.jobs` config, because Git knows they cannot safely run in parallel:
 `applypatch-msg`, `pre-commit`, `prepare-commit-msg`, `commit-msg`,
 `post-commit`, `post-checkout`, and `push-to-checkout`.
 
-- 
2.54.0.13.g9c7419e39f8


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

* [PATCH 3/4] doc: config: include existing git-hook(1) section
  2026-05-21 16:25 [PATCH 0/4] doc: hook: small improvements kristofferhaugsbakk
  2026-05-21 16:25 ` [PATCH 1/4] doc: hook: remove stray backtick kristofferhaugsbakk
  2026-05-21 16:25 ` [PATCH 2/4] doc: hook: consistently capitalize Git kristofferhaugsbakk
@ 2026-05-21 16:25 ` kristofferhaugsbakk
  2026-05-21 16:25 ` [PATCH 4/4] doc: hook: don’t self-link via config include kristofferhaugsbakk
  2026-05-23 10:24 ` [PATCH 0/4] doc: hook: small improvements Jean-Noël AVILA
  4 siblings, 0 replies; 8+ messages in thread
From: kristofferhaugsbakk @ 2026-05-21 16:25 UTC (permalink / raw)
  To: git; +Cc: Kristoffer Haugsbakk, jn.avila, adrian.ratiu

From: Kristoffer Haugsbakk <code@khaugsbakk.name>

It is already included in git-hook(1) but missing from git-config(1).

Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
---
 Documentation/config.adoc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/config.adoc b/Documentation/config.adoc
index dcea3c0c15e..a80e7db46d9 100644
--- a/Documentation/config.adoc
+++ b/Documentation/config.adoc
@@ -451,6 +451,8 @@ include::config/guitool.adoc[]
 
 include::config/help.adoc[]
 
+include::config/hook.adoc[]
+
 include::config/http.adoc[]
 
 include::config/i18n.adoc[]
-- 
2.54.0.13.g9c7419e39f8


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

* [PATCH 4/4] doc: hook: don’t self-link via config include
  2026-05-21 16:25 [PATCH 0/4] doc: hook: small improvements kristofferhaugsbakk
                   ` (2 preceding siblings ...)
  2026-05-21 16:25 ` [PATCH 3/4] doc: config: include existing git-hook(1) section kristofferhaugsbakk
@ 2026-05-21 16:25 ` kristofferhaugsbakk
  2026-05-23 10:24 ` [PATCH 0/4] doc: hook: small improvements Jean-Noël AVILA
  4 siblings, 0 replies; 8+ messages in thread
From: kristofferhaugsbakk @ 2026-05-21 16:25 UTC (permalink / raw)
  To: git; +Cc: Kristoffer Haugsbakk, jn.avila, adrian.ratiu

From: Kristoffer Haugsbakk <code@khaugsbakk.name>

Do not link to git-hook(1) from the config options when we already are
in that doc.

This implementation is similar to the updates to git-init(1) and
git-commit(1), implemented in [1] and [2], respectively.

† 1: e7b3a768 (doc: git-init: rework config item init.templateDir,
     2024-03-10)
† 2: 819fdd6e (doc: convert git commit config to new format, 2025-01-15)

Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
---
 Documentation/config/hook.adoc | 19 +++++++++++++------
 Documentation/git-hook.adoc    |  1 +
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/Documentation/config/hook.adoc b/Documentation/config/hook.adoc
index a9dc0063c12..083dc60a132 100644
--- a/Documentation/config/hook.adoc
+++ b/Documentation/config/hook.adoc
@@ -1,10 +1,17 @@
+ifdef::git-hook[]
+:see-git-hook:
+endif::git-hook[]
+ifndef::git-hook[]
+:see-git-hook: See linkgit:git-hook[1].
+endif::git-hook[]
+
 hook.<friendly-name>.command::
 	The command to execute for `hook.<friendly-name>`. `<friendly-name>`
 	is a unique name that identifies this hook. The hook events that
 	trigger the command are configured with `hook.<friendly-name>.event`.
 	The value can be an executable path or a shell oneliner. If more than
 	one value is specified for the same `<friendly-name>`, only the last
-	value parsed is used. See linkgit:git-hook[1].
+	value parsed is used. {see-git-hook}
 
 hook.<friendly-name>.event::
 	The hook events that trigger `hook.<friendly-name>`. The value is the
@@ -14,7 +21,7 @@ hook.<friendly-name>.event::
 	This is a multi-valued key. To run `hook.<friendly-name>` on multiple
 	events, specify the key more than once. An empty value resets
 	the list of events, clearing any previously defined events for
-	`hook.<friendly-name>`. See linkgit:git-hook[1].
+	`hook.<friendly-name>`. {see-git-hook}
 +
 The `<friendly-name>` must not be the same as a known hook event name
 (e.g. do not use `hook.pre-commit.event`). Using a known event name as
@@ -27,7 +34,7 @@ hook.<friendly-name>.enabled::
 	Set to `false` to disable the hook without removing its
 	configuration. This is particularly useful when a hook is defined
 	in a system or global config file and needs to be disabled for a
-	specific repository. See linkgit:git-hook[1].
+	specific repository. {see-git-hook}
 
 hook.<friendly-name>.parallel::
 	Whether the hook `hook.<friendly-name>` may run in parallel with other hooks
@@ -37,13 +44,13 @@ hook.<friendly-name>.parallel::
 	all hooks for that event run sequentially regardless of `hook.jobs`.
 	Only configured (named) hooks need to declare this. Traditional hooks
 	found in the hooks directory do not need to, and run in parallel when
-	the effective job count is greater than 1. See linkgit:git-hook[1].
+	the effective job count is greater than 1. {see-git-hook}
 
 hook.<event>.enabled::
 	Switch to enable or disable all hooks for the `<event>` hook event.
 	When set to `false`, no hooks fire for that event, regardless of any
 	per-hook `hook.<friendly-name>.enabled` settings. Defaults to `true`.
-	See linkgit:git-hook[1].
+	{see-git-hook}
 +
 Note on naming: `<event>` must be the event name (e.g. `pre-commit`),
 not a hook friendly-name. Since using a known event name as a
@@ -60,7 +67,7 @@ hook.<event>.jobs::
 	setting has no effect unless all configured hooks for the event have
 	`hook.<friendly-name>.parallel` set to `true`. Set to `-1` to use the
 	number of available CPU cores. Must be a positive integer or `-1`;
-	zero is rejected with a warning. See linkgit:git-hook[1].
+	zero is rejected with a warning. {see-git-hook}
 +
 Note on naming: although this key resembles `hook.<friendly-name>.*`
 (a per-hook setting), `<event>` must be the event name, not a hook
diff --git a/Documentation/git-hook.adoc b/Documentation/git-hook.adoc
index 750df58e58e..4868852aa0b 100644
--- a/Documentation/git-hook.adoc
+++ b/Documentation/git-hook.adoc
@@ -204,6 +204,7 @@ unintended and unsupported ways.
 
 CONFIGURATION
 -------------
+:git-hook: 1
 include::config/hook.adoc[]
 
 SEE ALSO
-- 
2.54.0.13.g9c7419e39f8


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

* Re: [PATCH 0/4] doc: hook: small improvements
  2026-05-21 16:25 [PATCH 0/4] doc: hook: small improvements kristofferhaugsbakk
                   ` (3 preceding siblings ...)
  2026-05-21 16:25 ` [PATCH 4/4] doc: hook: don’t self-link via config include kristofferhaugsbakk
@ 2026-05-23 10:24 ` Jean-Noël AVILA
  2026-05-23 11:43   ` Kristoffer Haugsbakk
  4 siblings, 1 reply; 8+ messages in thread
From: Jean-Noël AVILA @ 2026-05-23 10:24 UTC (permalink / raw)
  To: git, kristofferhaugsbakk; +Cc: Kristoffer Haugsbakk, adrian.ratiu

On Thursday, 21 May 2026 18:25:54 CEST kristofferhaugsbakk@fastmail.com wrote:
> From: Kristoffer Haugsbakk <code@khaugsbakk.name>
> 
> Topic name: kh/doc-hook
> 
> Topic summary: Small improvements to git-hook(1) and the associated config.
> 
> [1/4] doc: hook: remove stray backtick
> [2/4] doc: hook: consistently capitalize Git
> [3/4] doc: config: include existing git-hook(1) section
> [4/4] doc: hook: don’t self-link via config include
> 
>  Documentation/config.adoc      |  2 ++
>  Documentation/config/hook.adoc | 19 +++++++++++++------
>  Documentation/git-hook.adoc    | 11 ++++++-----
>  3 files changed, 21 insertions(+), 11 deletions(-)
> 
> 
> base-commit: aec3f587505a472db67e9462d0702e7d463a449d

This series looks good to me.

Thanks




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

* Re: [PATCH 0/4] doc: hook: small improvements
  2026-05-23 10:24 ` [PATCH 0/4] doc: hook: small improvements Jean-Noël AVILA
@ 2026-05-23 11:43   ` Kristoffer Haugsbakk
  2026-05-24  8:40     ` Junio C Hamano
  0 siblings, 1 reply; 8+ messages in thread
From: Kristoffer Haugsbakk @ 2026-05-23 11:43 UTC (permalink / raw)
  To: Jean-Noël AVILA, git; +Cc: Adrian Ratiu

On Sat, May 23, 2026, at 12:24, Jean-Noël AVILA wrote:
> On Thursday, 21 May 2026 18:25:54 CEST kristofferhaugsbakk@fastmail.com wrote:
>> From: Kristoffer Haugsbakk <code@khaugsbakk.name>
>>
>> Topic name: kh/doc-hook
>>
>> Topic summary: Small improvements to git-hook(1) and the associated config.
>>
>> [1/4] doc: hook: remove stray backtick
>> [2/4] doc: hook: consistently capitalize Git
>> [3/4] doc: config: include existing git-hook(1) section
>> [4/4] doc: hook: don’t self-link via config include
>>
>>  Documentation/config.adoc      |  2 ++
>>  Documentation/config/hook.adoc | 19 +++++++++++++------
>>  Documentation/git-hook.adoc    | 11 ++++++-----
>>  3 files changed, 21 insertions(+), 11 deletions(-)
>>
>>
>> base-commit: aec3f587505a472db67e9462d0702e7d463a449d
>
> This series looks good to me.

Thanks. Can I add your ack to the patches?

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

* Re: [PATCH 0/4] doc: hook: small improvements
  2026-05-23 11:43   ` Kristoffer Haugsbakk
@ 2026-05-24  8:40     ` Junio C Hamano
  0 siblings, 0 replies; 8+ messages in thread
From: Junio C Hamano @ 2026-05-24  8:40 UTC (permalink / raw)
  To: Kristoffer Haugsbakk; +Cc: Jean-Noël AVILA, git, Adrian Ratiu

"Kristoffer Haugsbakk" <kristofferhaugsbakk@fastmail.com> writes:

> On Sat, May 23, 2026, at 12:24, Jean-Noël AVILA wrote:
>> On Thursday, 21 May 2026 18:25:54 CEST kristofferhaugsbakk@fastmail.com wrote:
>>> From: Kristoffer Haugsbakk <code@khaugsbakk.name>
>>>
>>> Topic name: kh/doc-hook
>>>
>>> Topic summary: Small improvements to git-hook(1) and the associated config.
>>>
>>> [1/4] doc: hook: remove stray backtick
>>> [2/4] doc: hook: consistently capitalize Git
>>> [3/4] doc: config: include existing git-hook(1) section
>>> [4/4] doc: hook: don’t self-link via config include
>>>
>>>  Documentation/config.adoc      |  2 ++
>>>  Documentation/config/hook.adoc | 19 +++++++++++++------
>>>  Documentation/git-hook.adoc    | 11 ++++++-----
>>>  3 files changed, 21 insertions(+), 11 deletions(-)
>>>
>>>
>>> base-commit: aec3f587505a472db67e9462d0702e7d463a449d
>>
>> This series looks good to me.
>
> Thanks. Can I add your ack to the patches?

Sounds good.  Typically we only honor an explicit Reviewed-by:, but
we add Acked-by: a lot more casually.  "Looks good to me" you are
responding is typically good enough.

I'll mark the topic for 'next' in the draft edition of "What's
cooking" I work off of.

Thanks, both.

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

end of thread, other threads:[~2026-05-24  8:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-21 16:25 [PATCH 0/4] doc: hook: small improvements kristofferhaugsbakk
2026-05-21 16:25 ` [PATCH 1/4] doc: hook: remove stray backtick kristofferhaugsbakk
2026-05-21 16:25 ` [PATCH 2/4] doc: hook: consistently capitalize Git kristofferhaugsbakk
2026-05-21 16:25 ` [PATCH 3/4] doc: config: include existing git-hook(1) section kristofferhaugsbakk
2026-05-21 16:25 ` [PATCH 4/4] doc: hook: don’t self-link via config include kristofferhaugsbakk
2026-05-23 10:24 ` [PATCH 0/4] doc: hook: small improvements Jean-Noël AVILA
2026-05-23 11:43   ` Kristoffer Haugsbakk
2026-05-24  8:40     ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox