Re: [PATCH v2 1/2] Documentation: clarify %(contents:XXXX) doc
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 6, 2020, 21:34 UTC
- Message-ID
- <xmqqa70c9vkb.fsf@gitster.c.googlers.com>
- In-Reply-To
- <20200702140845.24945-2-chriscool@tuxfamily.org>
Christian Couder <christian.couder@gmail.com> writes:
Show 8 quoted lines
> Let's avoid a big dense paragraph by using an unordered > list for the %(contents:XXXX) format specifiers. > > Suggested-by: Jeff King <peff@peff.net> > Signed-off-by: Christian Couder <chriscool@tuxfamily.org> > --- > Documentation/git-for-each-ref.txt | 24 ++++++++++++++++++------ > 1 file changed, 18 insertions(+), 6 deletions(-)
Nice. Will queue. Thanks.
Show 36 quoted lines
> > diff --git a/Documentation/git-for-each-ref.txt b/Documentation/git-for-each-ref.txt > index 6dcd39f6f6..2db9779d54 100644 > --- a/Documentation/git-for-each-ref.txt > +++ b/Documentation/git-for-each-ref.txt > @@ -232,12 +232,24 @@ Fields that have name-email-date tuple as its value (`author`, > `committer`, and `tagger`) can be suffixed with `name`, `email`, > and `date` to extract the named component. > > -The complete message in a commit and tag object is `contents`. > -Its first line is `contents:subject`, where subject is the concatenation > -of all lines of the commit message up to the first blank line. The next > -line is `contents:body`, where body is all of the lines after the first > -blank line. The optional GPG signature is `contents:signature`. The > -first `N` lines of the message is obtained using `contents:lines=N`. > +The complete message of a commit or tag object is `contents`. This > +field can also be used in the following ways: > + > +contents:subject:: > + The "subject" of the commit or tag message. It's actually the > + concatenation of all lines of the commit message up to the > + first blank line. > + > +contents:body:: > + The "body" of the commit or tag message. It's made of the > + lines after the first blank line. > + > +contents:signature:: > + The optional GPG signature. > + > +contents:lines=N:: > + The first `N` lines of the message. > + > Additionally, the trailers as interpreted by linkgit:git-interpret-trailers[1] > are obtained as `trailers` (or by using the historical alias > `contents:trailers`). Non-trailer lines from the trailer block can be omitted