git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [QUESTION] ref-filter: how to support atom like %an

From
Junio C Hamano <gitster@pobox.com>
Date
May 16, 2021, 03:55 UTC
Message-ID
<xmqqk0nz72on.fsf@gitster.g>
In-Reply-To
<CAOLTT8QBOgcz+Q_ODnbGq5r5CzrSdX+=DMT0pJS6iPTcP0VRjA@mail.gmail.com>
ZheNing Hu <adlternative@gmail.com> writes:
Show 10 quoted lines
> My current thinking is this:
>
> First add a new member `short_name` in `struct valid_atom`,
> Then we can share a valid_atom item for the long name of
> an atom such as `%(authoremail)` and the short name of
> the atom `%ae` (%aE is not considered at the time).
> Something like:
>
> [ATOM_AUTHOREMAIL] = { "ae", "authoremail", SOURCE_OBJ, FIELD_STR,
> person_email_atom_parser },

My assumption has always been that when enriching "--format" of the "log" family (e.g. "status", "show") with ingredients from the "for-each-ref" family (e.g. "branch", "tag"), we would adopt the notation the latter uses, i.e. "git log --format='%s %(notes)'", with the full intention that eventually users would choose between the synonyms to make it "git log --format='%(subject) %(notes)'" for consistency, without wasting brain cycles to come up with and to remember two-letter shorthands that will not scale.

Previous: ZheNing HuNext: ZheNing Hu
Message 2 of 3 in “[QUESTION] ref-filter: how to support atom like %an”
  1. ZheNing HuMay 15, 2021
  2. Junio C HamanoMay 16, 2021
  3. ZheNing HuMay 17, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.