Git development
 help / color / mirror / Atom feed
From: kristofferhaugsbakk@fastmail.com
To: phillip.wood123@gmail.com
Cc: ben.knoble@gmail.com, git@vger.kernel.org,
	kristofferhaugsbakk@fastmail.com
Subject: Re: [PATCH v3 5/5] format-rev: introduce builtin for on-demand pretty formatting
Date: Fri,  1 May 2026 20:27:16 +0200	[thread overview]
Message-ID: <20260501182718.27853-2-kristofferhaugsbakk@fastmail.com> (raw)
In-Reply-To: <e8bb57a2-8eff-4f72-96ca-72d8880901e0@gmail.com>

On Fri, May 1, 2026, at 12:16, Phillip Wood wrote:
>>[snip]
>> • You can’t feed commits piecemeal to these commands, one input
>>    for one output; they block until standard in is closed
>
> So you can feed them piecemeal but you don't get any output until you
> close stdin. That can be helpful as it means the calling process can
> write to "git log --stdin" and then read the output without worrying
> about getting deadlocked.

Okay. I don’t have much experience with concurrent programming.

> The Implementation below works fine if there
> are separate processes or threads writing to and reading from "git
> format-rev", but if we want a single process to be able to read from and
> write to "git format-rev --stdin-mode=text" there will need to be a way
> to delimit message boundaries so that git knows where the input message
> ends and the caller knows where the response ends.

Okay, so I guess a null-terminator mode for output.

> We'll also need to be
> careful about flushing the output at the end of a processed message.

I don’t get why this takes special care. I’ll think about it.

> For "--stdin-mode=revs" the caller cannot know how many lines the output
> will span because formats like %(trailers) will produce a variable
> number of lines depending on which trailers are present. It is also
> possible for a rev name to span more than one line. The following
> example finds the most recent commit that mentions 'cherry-pick' in the
> subject line
>
> :/^[^
> ]cherry-pick
>
> so we need a way to delimit the input and output records there as well.

Okay, so a null-terminator mode for input as well?

> I think the functionality implemented here is useful (transforming the
> output of 'git blame' or 'git-last-modified' are convicing examples) and
> it is probably better to do it as a command rather than adding a
> "--format" option to name-rev.
>
>> • You can’t feed a list of possibly duplicate commits, like the output
>>    of git-last-modified(1); they effectively deduplicate the output
>
> That is definitely a problem

Great, thanks.

>> Beyond these two points there’s also the input massage problem: you
>
> s/massagge/message/?

No. I meant massaging the input so that it can be processed by whatever
tool you have. :) In this case splitting the object name column and file
column because tools like git-log(1) can only deal with revision input.

Thanks for reviewing the usability design.

-- 
Happy May Day

  reply	other threads:[~2026-05-01 18:27 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 [this message]
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
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=20260501182718.27853-2-kristofferhaugsbakk@fastmail.com \
    --to=kristofferhaugsbakk@fastmail.com \
    --cc=ben.knoble@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=phillip.wood123@gmail.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