diff options
| author | Adrian Ratiu <adrian.ratiu@collabora.com> | 2026-03-25 21:55:01 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-03-25 14:00:47 -0700 |
| commit | b66efad2b1f53755a80699dc39f94e2b15d6af67 (patch) | |
| tree | 3e42cefd6493973af8c8e6e6aa6059836cb1fc50 /path.c | |
| parent | d8513bc5d84f21ea6d327a9cf9a369077eb19c67 (diff) | |
| download | git-b66efad2b1f53755a80699dc39f94e2b15d6af67.tar.xz | |
hook: show config scope in git hook list
Users running "git hook list" can see which hooks are configured but
have no way to tell at which config scope (local, global, system...)
each hook was defined.
Store the scope from ctx->kvi->scope in the single-pass config callback,
then carry it through the cache to the hook structs, so we can expose it
to users via the "git hook list --show-scope" flag, which mirrors the
existing git config --show-scope convention.
Without the flag the output is unchanged.
The scope is printed as a tab-separated prefix (like "git config --show-scope"),
making it unambiguously machine-parseable even when the friendly name
contains spaces.
Example usage:
$ git hook list --show-scope pre-commit
global linter
local no-leaks
hook from hookdir
Traditional hooks from the hookdir are unaffected by --show-scope since
the config scope concept does not apply to them.
Suggested-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'path.c')
0 files changed, 0 insertions, 0 deletions
