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

Re: [RFC] ref-filter: add new atom `signature`

From
Christian Couder <christian.couder@gmail.com>
Date
Jul 1, 2020, 09:52 UTC
Message-ID
<CAP8UFD2qbtoXay1AgwrdaJ8XgVkq=NqBTa=KptUTop19xzUVuQ@mail.gmail.com>
In-Reply-To
<CA+CkUQ_-_Rzu00w1L7QeMxT73a_MsD=8kY0+wtuRmze4z+1_AA@mail.gmail.com>
Hi,
On Sun, Jun 28, 2020 at 12:05 PM Hariom verma <hariom18599@gmail.com> wrote:
Show 5 quoted lines
>
> Hi,
>
> In ref-filter, we have a bunch of atoms which serves as a formatting
> option for `git for-each-ref`.
Ok.
> Despite of having 'subject' as an argument to 'contents' [i.e
> `%(contents:subject)`], we still have 'subject' as an atom [i.e
> `%(subject)`].
> Likewise for `%(contents:signature)`, we can have 'signature' as an atom too.

Ok. Some things are available in different ways perhaps because of historical reasons and backward compatibility.

> Currently, `%(contents:signature)` internally uses `parse_signature()`
> that only works for signed tag objects. I plan to expand the scope of
> `signature` by defining it as an atom and will make it work for
> commits too.

Didn't you say already that "we can have 'signature' as an atom too", so isn't it already defined as an atom? Does `%(contents:signature)` work for commits while '%(signature)' doesn't? And what happens when it doesn't work?

> Also, thinking of adding `signer`, `key`, `fingerprint`,
> `primarykeyfingerprint`, `trustlevel` and `grade`[print 'G' for good,
> 'B' for bad...] as arguments to "signature".
Ok, I guess all the above arguments would be new.
Show 8 quoted lines
> This change will also help me in using ref-filter's logic in pretty.c
> for formatting options like "GG", "G?", etc. To know more about these
> formatting options, you can take a look here[1].
>
> If curious about what approach I'm taking for using ref-filter logic
> in pretty.c, see[2]
>
> Would love hear your thoughts on it. Any suggestions will also be appreciated.

It would be nice to see, at least for the atoms or arguments that you are planning to, or have already, worked on, a list showing how each formatting option in pretty.c maps to one or more atoms possibly with arguments.

For example something like:
%GS: show the name of the signer for a signed commit
  maps to: %(signature:signer)
  status: yet to be implemented

Thanks, Christian.

Previous: Hariom vermaNext: Hariom verma
Message 2 of 3 in “[RFC] ref-filter: add new atom `signature`”
  1. Hariom vermaJun 28, 2020
  2. Christian CouderJul 1, 2020
  3. Hariom vermaJul 1, 2020

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.