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

[RFC] Relaxing interpret-trailers' interpretation rules

From
Phil Hord <phil.hord@gmail.com>
Date
Aug 20, 2019, 02:13 UTC
Message-ID
<CABURp0r2sn7LUYFNegLVx5G+zZXpiPz2YdmKfG1EDHkXf61E+Q@mail.gmail.com>

I'm trying to include "Bug" numbers from commit messages in my one-line log output, like this: git log --pretty="%h %(trailers:key=Bug,valueonly,separator=;) %s"

But I have a problem. We have a tool that appends a trailer to commit messages like this:

   Reviewed at https://reviews.myco.com/012345

Unfortunately, it adds a newline before this line, effectively making 'git interpret-trailers' think there are no other trailers.

    foo: add new feature foo
    yadda yadda yadda
    Bug: PROJ-155485
    Testing: https://jenkins/job/foo-functional/1/console
    Reviewed at https://reviews.myco.com/012345

I could fix this going forward, but it doesn't help with my existing project and various users' similar formats.

I'm thinking of adding a switch to interpret-trailers to tell it not to stop searching for my trailer key at the last blank line in the message. This feels like it will cheapen the purpose of interpret-trailers, though.

Do you have thoughts on this idea?

Another option I considered is adding some extension to --pretty's format to let me post-process fields in a command. I don't think such a thing already exists, but with the myriad log formats available, maybe I've overlooked something.

Message 1 of 1 in “[RFC] Relaxing interpret-trailers' interpretation rules”
  1. Phil HordAug 20, 2019

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.