Re: [PATCH v2 2/2] name-rev: learn --format=<pretty>
On Fri, Mar 20, 2026 at 9:13 AM <kristofferhaugsbakk@fastmail.com> wrote:
Show 5 quoted lines
>
> From: Kristoffer Haugsbakk <code@khaugsbakk.name>
>
> Teach git-name-rev(1) to format the given revisions instead of creating
> symbolic names.
Show 11 quoted lines
> ---
>
> Notes (series):
> v2:
> • Propely implement “--format implies --name-only”
> • Don’t use a needless intermediary struct
> • Add a new member to `name_rev_usage[]`
> • FREE_AND_NULL notes string. There is no use-after-free but we have no
> reason to leave a freed pointer just laying there
> • Implement `--notes` for `%N` atom use (not just restrict to the default
> notes ref)
Show 27 quoted lines
> diff --git a/Documentation/git-name-rev.adoc b/Documentation/git-name-rev.adoc
> index d4f1c4d5945..65348690c8c 100644
> --- a/Documentation/git-name-rev.adoc
> +++ b/Documentation/git-name-rev.adoc
> @@ -9,7 +9,7 @@ git-name-rev - Find symbolic names for given revs
> SYNOPSIS
> --------
> [verse]
> -'git name-rev' [--tags] [--refs=<pattern>]
> +'git name-rev' [--tags] [--refs=<pattern>] [--format=<pretty>]
> ( --all | --annotate-stdin | <commit-ish>... )
>
> DESCRIPTION
> @@ -21,6 +21,14 @@ format parsable by 'git rev-parse'.
> OPTIONS
> -------
>
> +--format=<pretty>::
> +--no-format::
> + Format revisions instead of outputting symbolic names. The
> + default is `--no-format`.
> ++
> +Implies `--name-only`. The negation `--no-format` implies
> +`--no-name-only` (the default for the command).
> +
> --tags::
> Do not use branch names, but only tags to name the commits
IIUC that this patch also adds --notes, should it be documented here?