Git development
 help / color / mirror / Atom feed
From: "Kristoffer Haugsbakk" <kristofferhaugsbakk@fastmail.com>
To: git@vger.kernel.org
Cc: "D. Ben Knoble" <ben.knoble@gmail.com>,
	"Phillip Wood" <phillip.wood@dunelm.org.uk>,
	"Ramsay Jones" <ramsay@ramsayjones.plus.com>,
	"Junio C Hamano" <gitster@pobox.com>
Subject: Re: [PATCH v4 5/5] format-rev: introduce builtin for on-demand pretty formatting
Date: Fri, 08 May 2026 15:25:26 +0200	[thread overview]
Message-ID: <c04d9cf9-e6a9-4e12-8025-9baededfdafc@app.fastmail.com> (raw)
In-Reply-To: <V4_format-rev_new_builtin.6af@msgid.xyz>

On Thu, May 7, 2026, at 21:34, me myself wrote:
> From: Kristoffer Haugsbakk <code@khaugsbakk.name>
>[snip]
> +[[io]]
> +INPUT AND OUTPUT FORMAT
> +-----------------------
> +
> +The command uses newlines for both input and output termination by
> +default. See the `-z`, `--null-output`, and `--null-input` options for
> +using _NUL_ character as the terminator.
> +
> +The mode `--stdin-mode=revs` outputs one formatted commit followed by
> +the terminator. This could either be called a _line_ or a _record_ in
> +case "line" is too suggestive of newline termination.
> +
> +Note that this means that the terminator character (newline or _NUL_)
> +acts as a _terminator_, not a _separator_. In other words, the final
> +line or record is also terminated by the terminator character.
> +
> +The mode `--stdin-mode=text` replaces each object name with the
> +formatted commit, i.e. the format `%s` would transform the object name
> +`abcdef012...` to `<subject>` without any termination. Like this:
> +
> +----
> +Did we not fix this in "<subject>"?
> +----
> +
> +Regarding input in this mode: using `-z` or `--null-input` makes sure
> +that _NUL_ characters in the input are passed through correctly.

This was the paragraph that I was unhappy with (see cover letter).

We’re supposed to be dealing with text here. So on second thought I
don’t think we need to fuzz about passing through NUL characters.

Instead I could mention that `-z` for this mode allows you to further
transform running text from other commands that use NUL
termination. Like `git last-modified -z` (see the Examples section).

> +
> +It is safe to interactively read and write from this command since each
> +record is immediately flushed.
> +
> +[[examples]]
> +EXAMPLES
> +--------
> +
> +The command linkgit:git-last-modified[1] shows the commit that each file
> +was last modified in.
>[snip]

  reply	other threads:[~2026-05-08 13:25 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-13 16:03 [PATCH 0/2] name-rev: learn --format=<pretty> kristofferhaugsbakk
2026-03-13 16:03 ` [PATCH 1/2] name-rev: wrap both blocks in braces kristofferhaugsbakk
2026-03-14  0:22   ` Junio C Hamano
2026-03-17 22:10     ` Kristoffer Haugsbakk
2026-03-13 16:03 ` [PATCH 2/2] name-rev: learn --format=<pretty> kristofferhaugsbakk
2026-03-14  0:22   ` Junio C Hamano
2026-03-17 22:07     ` Kristoffer Haugsbakk
2026-03-18 15:36       ` Kristoffer Haugsbakk
2026-03-20 13:09 ` [PATCH v2 0/2] " kristofferhaugsbakk
2026-03-20 13:09   ` [PATCH v2 1/2] name-rev: wrap both blocks in braces kristofferhaugsbakk
2026-03-20 13:09   ` [PATCH v2 2/2] name-rev: learn --format=<pretty> kristofferhaugsbakk
2026-03-20 15:25     ` D. Ben Knoble
2026-03-23 17:34       ` Kristoffer Haugsbakk
2026-04-28 22:25   ` [PATCH v3 0/5] format-rev: introduce builtin for on-demand pretty formatting kristofferhaugsbakk
2026-04-28 22:25     ` [PATCH v3 1/5] name-rev: wrap both blocks in braces kristofferhaugsbakk
2026-04-28 22:25     ` [PATCH v3 2/5] name-rev: run clang-format before factoring code kristofferhaugsbakk
2026-04-28 22:25     ` [PATCH v3 3/5] name-rev: factor code for sharing with a new command kristofferhaugsbakk
2026-04-30 13:54       ` Phillip Wood
2026-05-01 17:24         ` kristofferhaugsbakk
2026-05-02 10:00           ` Phillip Wood
2026-05-05 19:21             ` Kristoffer Haugsbakk
2026-04-28 22:25     ` [PATCH v3 4/5] name-rev: make dedicated --annotate-stdin --name-only test kristofferhaugsbakk
2026-04-28 22:25     ` [PATCH v3 5/5] format-rev: introduce builtin for on-demand pretty formatting kristofferhaugsbakk
2026-04-29 13:41       ` Kristoffer Haugsbakk
2026-04-30  6:23         ` Kristoffer Haugsbakk
2026-04-30  9:21       ` Kristoffer Haugsbakk
2026-05-01 10:16       ` Phillip Wood
2026-05-01 18:27         ` kristofferhaugsbakk
2026-05-02 10:00           ` Phillip Wood
2026-05-05 19:27             ` Kristoffer Haugsbakk
2026-05-03 19:19       ` Junio C Hamano
2026-05-07 19:34     ` [PATCH v4 0/5] " kristofferhaugsbakk
2026-05-07 19:34       ` [PATCH v4 1/5] name-rev: wrap both blocks in braces kristofferhaugsbakk
2026-05-07 19:34       ` [PATCH v4 2/5] name-rev: run clang-format before factoring code kristofferhaugsbakk
2026-05-07 19:34       ` [PATCH v4 3/5] name-rev: factor code for sharing with a new command kristofferhaugsbakk
2026-05-07 19:34       ` [PATCH v4 4/5] name-rev: make dedicated --annotate-stdin --name-only test kristofferhaugsbakk
2026-05-07 19:34       ` [PATCH v4 5/5] format-rev: introduce builtin for on-demand pretty formatting kristofferhaugsbakk
2026-05-08 13:25         ` Kristoffer Haugsbakk [this message]
2026-05-11 13:25         ` Kristoffer Haugsbakk
2026-05-11 15:45       ` [PATCH v5 0/5] " kristofferhaugsbakk
2026-05-11 15:45         ` [PATCH v5 1/5] name-rev: wrap both blocks in braces kristofferhaugsbakk
2026-05-11 15:45         ` [PATCH v5 2/5] name-rev: run clang-format before factoring code kristofferhaugsbakk
2026-05-11 15:45         ` [PATCH v5 3/5] name-rev: factor code for sharing with a new command kristofferhaugsbakk
2026-05-11 15:45         ` [PATCH v5 4/5] name-rev: make dedicated --annotate-stdin --name-only test kristofferhaugsbakk
2026-05-11 15:45         ` [PATCH v5 5/5] format-rev: introduce builtin for on-demand pretty formatting kristofferhaugsbakk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c04d9cf9-e6a9-4e12-8025-9baededfdafc@app.fastmail.com \
    --to=kristofferhaugsbakk@fastmail.com \
    --cc=ben.knoble@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=phillip.wood@dunelm.org.uk \
    --cc=ramsay@ramsayjones.plus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox