{"thread":{"id":"53767","subject":"[RFC] ref-filter: add new atom `signature`","startedAt":"2020-06-28T10:08:29Z","lastAt":"2020-07-01T11:55:20Z","messageCount":3,"participants":["Hariom verma","Christian Couder"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"400736","messageId":"CA+CkUQ_-_Rzu00w1L7QeMxT73a_MsD=8kY0+wtuRmze4z+1_AA@mail.gmail.com","threadId":"53767","inReplyTo":null,"subject":"[RFC] ref-filter: add new atom `signature`","fromName":"Hariom verma","fromEmail":"hariom18599@gmail.com","sentAt":"2020-06-28T10:05:34Z","receivedAt":"2020-06-28T10:08:29Z","isPatch":false,"sender":{"key":"hariom18599@gmail.com","avatar":"https://avatars.githubusercontent.com/u/37576387?v=4"},"body":"Hi,\n\nIn ref-filter, we have a bunch of atoms which serves as a formatting\noption for `git for-each-ref`.\n\nDespite of having 'subject' as an argument to 'contents' [i.e\n`%(contents:subject)`], we still have 'subject' as an atom [i.e\n`%(subject)`].\nLikewise for `%(contents:signature)`, we can have 'signature' as an atom too.\n\nCurrently, `%(contents:signature)` internally uses `parse_signature()`\nthat only works for signed tag objects. I plan to expand the scope of\n`signature` by defining it as an atom and will make it work for\ncommits too.\nAlso, thinking of adding `signer`, `key`, `fingerprint`,\n`primarykeyfingerprint`, `trustlevel` and `grade`[print 'G' for good,\n'B' for bad...] as arguments to \"signature\".\n\nThis change will also help me in using ref-filter's logic in pretty.c\nfor formatting options like \"GG\", \"G?\", etc. To know more about these\nformatting options, you can take a look here[1].\n\nIf curious about what approach I'm taking for using ref-filter logic\nin pretty.c, see[2]\n\nWould love hear your thoughts on it. Any suggestions will also be appreciated.\n\nThanks,\nHariom\n\n[1]: https://github.com/git/git/blob/f402ea68166bd77f09b176c96005ac7f8886e14b/Documentation/pretty-formats.txt#L221-L235\n[2]: https://public-inbox.org/git/pull.658.git.1592218662.gitgitgadget@gmail.com/\n"},{"id":"400879","messageId":"CAP8UFD2qbtoXay1AgwrdaJ8XgVkq=NqBTa=KptUTop19xzUVuQ@mail.gmail.com","threadId":"53767","inReplyTo":"CA+CkUQ_-_Rzu00w1L7QeMxT73a_MsD=8kY0+wtuRmze4z+1_AA@mail.gmail.com","subject":"Re: [RFC] ref-filter: add new atom `signature`","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2020-07-01T09:52:52Z","receivedAt":"2020-07-01T09:53:07Z","isPatch":false,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Hi,\n\nOn Sun, Jun 28, 2020 at 12:05 PM Hariom verma <hariom18599@gmail.com> wrote:\n>\n> Hi,\n>\n> In ref-filter, we have a bunch of atoms which serves as a formatting\n> option for `git for-each-ref`.\n\nOk.\n\n> Despite of having 'subject' as an argument to 'contents' [i.e\n> `%(contents:subject)`], we still have 'subject' as an atom [i.e\n> `%(subject)`].\n> Likewise for `%(contents:signature)`, we can have 'signature' as an atom too.\n\nOk. Some things are available in different ways perhaps because of\nhistorical reasons and backward compatibility.\n\n> Currently, `%(contents:signature)` internally uses `parse_signature()`\n> that only works for signed tag objects. I plan to expand the scope of\n> `signature` by defining it as an atom and will make it work for\n> commits too.\n\nDidn't you say already that \"we can have 'signature' as an atom too\",\nso isn't it already defined as an atom? Does `%(contents:signature)`\nwork for commits while '%(signature)' doesn't? And what happens when\nit doesn't work?\n\n> Also, thinking of adding `signer`, `key`, `fingerprint`,\n> `primarykeyfingerprint`, `trustlevel` and `grade`[print 'G' for good,\n> 'B' for bad...] as arguments to \"signature\".\n\nOk, I guess all the above arguments would be new.\n\n> This change will also help me in using ref-filter's logic in pretty.c\n> for formatting options like \"GG\", \"G?\", etc. To know more about these\n> formatting options, you can take a look here[1].\n>\n> If curious about what approach I'm taking for using ref-filter logic\n> in pretty.c, see[2]\n>\n> Would love hear your thoughts on it. Any suggestions will also be appreciated.\n\nIt would be nice to see, at least for the atoms or arguments that you\nare planning to, or have already, worked on, a list showing how each\nformatting option in pretty.c maps to one or more atoms possibly with\narguments.\n\nFor example something like:\n\n%GS: show the name of the signer for a signed commit\n  maps to: %(signature:signer)\n  status: yet to be implemented\n\nThanks,\nChristian.\n"},{"id":"400891","messageId":"CA+CkUQ9dW9E+yujwU0A7KYu6-fdK9Y4q31+Gq6-9AYoyLyQT6Q@mail.gmail.com","threadId":"53767","inReplyTo":"CAP8UFD2qbtoXay1AgwrdaJ8XgVkq=NqBTa=KptUTop19xzUVuQ@mail.gmail.com","subject":"Re: [RFC] ref-filter: add new atom `signature`","fromName":"Hariom verma","fromEmail":"hariom18599@gmail.com","sentAt":"2020-07-01T11:55:06Z","receivedAt":"2020-07-01T11:55:20Z","isPatch":false,"sender":{"key":"hariom18599@gmail.com","avatar":"https://avatars.githubusercontent.com/u/37576387?v=4"},"body":"Hi,\n\nOn Wed, Jul 1, 2020 at 3:23 PM Christian Couder\n<christian.couder@gmail.com> wrote:\n>\n> Hi,\n>\n> On Sun, Jun 28, 2020 at 12:05 PM Hariom verma <hariom18599@gmail.com> wrote:\n> >\n> > Hi,\n> >\n> > In ref-filter, we have a bunch of atoms which serves as a formatting\n> > option for `git for-each-ref`.\n>\n> Ok.\n>\n> > Despite of having 'subject' as an argument to 'contents' [i.e\n> > `%(contents:subject)`], we still have 'subject' as an atom [i.e\n> > `%(subject)`].\n> > Likewise for `%(contents:signature)`, we can have 'signature' as an atom too.\n>\n> Ok. Some things are available in different ways perhaps because of\n> historical reasons and backward compatibility.\n\nOkay.\n\n> > Currently, `%(contents:signature)` internally uses `parse_signature()`\n> > that only works for signed tag objects. I plan to expand the scope of\n> > `signature` by defining it as an atom and will make it work for\n> > commits too.\n>\n> Didn't you say already that \"we can have 'signature' as an atom too\",\n> so isn't it already defined as an atom? Does `%(contents:signature)`\n> work for commits while '%(signature)' doesn't? And what happens when\n> it doesn't work?\n\nSorry for the ambiguity in my statement.\n- Only `contents` exists as an atom, which accepts `signature` as an\nargument. i.e '%(contents:signature)'\n- 'signature' does not exist as an atom. I plan to add this.\n- `%(contents: signature)` only works for tag objects. For commit it\nprints nothing.\n\n> > Also, thinking of adding `signer`, `key`, `fingerprint`,\n> > `primarykeyfingerprint`, `trustlevel` and `grade`[print 'G' for good,\n> > 'B' for bad...] as arguments to \"signature\".\n>\n> Ok, I guess all the above arguments would be new.\n\nYes\n\n> > This change will also help me in using ref-filter's logic in pretty.c\n> > for formatting options like \"GG\", \"G?\", etc. To know more about these\n> > formatting options, you can take a look here[1].\n> >\n> > If curious about what approach I'm taking for using ref-filter logic\n> > in pretty.c, see[2]\n> >\n> > Would love hear your thoughts on it. Any suggestions will also be appreciated.\n>\n> It would be nice to see, at least for the atoms or arguments that you\n> are planning to, or have already, worked on, a list showing how each\n> formatting option in pretty.c maps to one or more atoms possibly with\n> arguments.\n>\n> For example something like:\n>\n> %GS: show the name of the signer for a signed commit\n>   maps to: %(signature:signer)\n>   status: yet to be implemented\n>\n\nYeah, that would be nice.\n\n## User Formats\n\n%H: commit hash\nmaps to: \"%(objectname)\"\nstatus: Implemented\n\n%h: abbreviated commit hash\nmaps to: \"%(objectname:short)\"\nstatus: Implemented\n\n%T: tree hash\nmaps to: \"%(tree)\"\nstatus: Implemented\n\n%t: abbreviated tree hash\nmaps to: \"%(tree:short)\"\nstatus: Implemented\n\n%P: parent hashes\nmaps to: \"%(parent)\"\nstatus: Implemented\n\n%p: abbreviated parent hashes\nmaps to: \"%(parent:short)\"\nstatus: Implemented\n\n%an: author name\nmaps to: \"%(authorname)\"\nstatus: Implemented\n\n%ae: author email\nmaps to: \"%(authoremail)\"\nstatus: Implemented\n\n%ad: author date\nmaps to: \"%(authordate)\"\nstatus: Implemented\n\n%cn: committer name\nmaps to: \"%(committername)\"\nstatus: Implemented\n\n%ce: committer email\nmaps to: \"%(committeremail)\"\nstatus: Implemented\n\n%cd: committer date\nmaps to: \"%(committerdate)\"\nstatus: Implemented\n\n%s: subject\nmaps to: \"%(subject)\"\nstatus: Implemented\n\n%f: sanitized subject line, suitable for a filename\nmaps to: \"%(subject:sanitize)\"\nstatus: Implemented\n\n%b: body\nmaps to: \"%(body)\"\nstatus: Implemented\n\n%GG: raw verification message from GPG for a signed commit\nmaps to: %(signature)\nstatus: Implemented\n\n%G?: show \"G\" for a good (valid) signature, \"B\" for a bad signature...\nmaps to: \"%(signature:grade)\"\nstatus: In progress\n\n%GS: show the name of the signer for a signed commit\nmaps to: \"%(signature:signer)\"\nstatus: Implemented\n\n%GK: show the key used to sign a signed commit\nmaps to: \"%(signature:key)\"\nstatus: Implemented\n\n%GF: show the fingerprint of the key used to sign a signed commit\nmaps to: \"%(signature:fingerprint)\"\nstatus: Implemented\n\n%GP: show the fingerprint of the primary key whose subkey was used to\nsign a signed commit\nmaps to: \"%(signature:primarykeyfingerprint)\"\nstatus: Implemented\n\n%GT: show the trust level for the key used to sign a signed commit\nmaps to: \"%(signature:trustlevel)\"\nstatus: In progress\n\n## Commit Formats\n\nNote: This is only for the commit body[as pretty.c only handles commit\nbody]. First line that contains `commit hash` is handled by\nlog-tree.c, So no need to map it.\n\n'oneline'\nmaps to: \"%(subject)\"\nstatus: implemented\n\n'short'\nmaps to: \"Author: %(authorname) %(authoremail)\\n\\n\\t%(subject)\\n\"\nstatus: Implemented\n\n'medium'\nmaps to: \"Author: %(authorname)\n%(authoremail)\\nDate:\\t%(authordate)\\n\\n%(subject)\\n\\n%(body)\"\nstatus: Implemeted\n\n'full'\nmaps to: \"Author: %(authorname) %(authoremail)\\nCommit:\n%(committername) %(committeremail)\\n\\n%(subject)\\n\\n%(body)\"\nstatus: Implemented\n\n'fuller'\nmaps to: \"Author:\\t\\t%(authorname)\n%(authoremail)\\nAuthorDate:\\t%(authordate)\\nCommit:\\t\\t%(committername)\n%(committeremail)\\nCommitDate:\\t%(committerdate)\\n\\n%(subject)\\n\\n%(body)\"\nstatus: Implemented\n\n'raw'\nstatus: Not yet Implemented\n\nThanks,\nHariom\n"}]}