From: Phil Hord <phil.hord@gmail.com>
To: Git <git@vger.kernel.org>
Cc: Christian Couder <chriscool@tuxfamily.org>
Subject: [RFC] Relaxing interpret-trailers' interpretation rules
Date: Mon, 19 Aug 2019 19:13:59 -0700 [thread overview]
Message-ID: <CABURp0r2sn7LUYFNegLVx5G+zZXpiPz2YdmKfG1EDHkXf61E+Q@mail.gmail.com> (raw)
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.
reply other threads:[~2019-08-20 2:14 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CABURp0r2sn7LUYFNegLVx5G+zZXpiPz2YdmKfG1EDHkXf61E+Q@mail.gmail.com \
--to=phil.hord@gmail.com \
--cc=chriscool@tuxfamily.org \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).