{"thread":{"id":"51688","subject":"[RFC] Relaxing interpret-trailers' interpretation rules","startedAt":"2019-08-20T02:14:15Z","lastAt":"2019-08-20T02:14:15Z","messageCount":1,"participants":["Phil Hord"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"380753","messageId":"CABURp0r2sn7LUYFNegLVx5G+zZXpiPz2YdmKfG1EDHkXf61E+Q@mail.gmail.com","threadId":"51688","inReplyTo":null,"subject":"[RFC] Relaxing interpret-trailers' interpretation rules","fromName":"Phil Hord","fromEmail":"phil.hord@gmail.com","sentAt":"2019-08-20T02:13:59Z","receivedAt":"2019-08-20T02:14:15Z","isPatch":false,"sender":{"key":"phil.hord@gmail.com","avatar":"https://avatars.githubusercontent.com/u/123908?v=4"},"body":"I'm trying to include \"Bug\" numbers from commit messages in my\none-line log output, like this:\ngit log --pretty=\"%h %(trailers:key=Bug,valueonly,separator=;) %s\"\n\nBut I have a problem.  We have a tool that appends a trailer to commit\nmessages like this:\n\n   Reviewed at https://reviews.myco.com/012345\n\nUnfortunately, it adds a newline before this line, effectively making\n'git interpret-trailers' think there are no other trailers.\n\n    foo: add new feature foo\n\n    yadda yadda yadda\n\n    Bug: PROJ-155485\n    Testing: https://jenkins/job/foo-functional/1/console\n\n    Reviewed at https://reviews.myco.com/012345\n\nI could fix this going forward, but it doesn't help with my existing\nproject and various users' similar formats.\n\nI'm thinking of adding a switch to interpret-trailers to tell it not\nto stop searching for my trailer key at the last blank line in the\nmessage.  This feels like it will cheapen the purpose of\ninterpret-trailers, though.\n\nDo you have thoughts on this idea?\n\nAnother option I considered is adding some extension to --pretty's\nformat to let me post-process fields in a command.  I don't think such\na thing already exists, but with the myriad log formats available,\nmaybe I've overlooked something.\n"}]}