public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: "D. Ben Knoble" <ben.knoble@gmail•com>
Cc: David Moberg <David.Moberg@mediatek•com>,
	 "git@vger•kernel.org" <git@vger•kernel.org>
Subject: Re: git log format documentation/manpage
Date: Sat, 25 Oct 2025 09:35:32 -0700	[thread overview]
Message-ID: <xmqq4irnndm3.fsf@gitster.g> (raw)
In-Reply-To: <CALnO6CBLUGgBMeRf0uLA=TKVaMQvap9Wpa4uTAGQD5he40xeWw@mail.gmail.com> (D. Ben Knoble's message of "Sat, 25 Oct 2025 09:42:03 -0400")

"D. Ben Knoble" <ben.knoble@gmail•com> writes:

> I don't have the answer to everything, but for your goal, does
> `--oneline --notes` not give you something close enough?
>
> Since notes can be arbitrary text, making them "inline" with the
> oneline format seems like an uphill battle to me.

A commit log message is an arbitrary piece of text, so we gave the
distinction of %s (subject) vs %b (body) to allow us to say "%h %s"
to show only the commit subject.

There is nothing similar for notes, so in that sense, you are
correct to point out that only with %N, it would not be possible to
come up with universally good formatting, unless you somehow control
what you write in your notes (e.g. limit yourself to oneliners).

If the rumored unification of format languages between "git log"
family of commands and "git for-each-ref" family of commands ever
comes, then we might be able to borrow conditional formatting and
text manipulation primitives the latter may have in order to do
things like "show the first line of note string, inside a pair of
parentheses, but only do so when note does exist and not empty".

But until the unification of format languages happens (which as far
as I understand nobody is working on right now, even though I
vaguely recall it was a topic in vogue for mentoring programs some
years ago), I do not think it is feasible.

  reply	other threads:[~2025-10-25 16:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-24  8:06 git log format documentation/manpage David Moberg
2025-10-25 13:42 ` D. Ben Knoble
2025-10-25 16:35   ` Junio C Hamano [this message]
2025-10-25 17:00 ` René Scharfe

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=xmqq4irnndm3.fsf@gitster.g \
    --to=gitster@pobox$(echo .)com \
    --cc=David.Moberg@mediatek$(echo .)com \
    --cc=ben.knoble@gmail$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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