for-each-ref: add split message parts to %(contents:*).
The %(body) placeholder returns the whole body of a tag or
commit, including the signature. However, callers may want
to get just the body without signature, or just the
signature.
Rather than change the meaning of %(body), which might break
some scripts, this patch introduces a new set of
placeholders which break down the %(contents) placeholder
into its constituent parts.
[jk: initial patch by mg, rebased on top of my refactoring
and with tests by me]
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Michał Górny14 years agocommitted byJunio C Hamano
@ -101,9 +101,10 @@ Fields that have name-email-date tuple as its value (`author`,
@@ -101,9 +101,10 @@ 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 first line of the message in a commit and tag object is
`subject`, the remaining lines are `body`. The whole message
is `contents`.
The complete message in a commit and tag object is `contents`.
Its first line is `contents:subject`, the remaining lines
are `contents:body` and the optional GPG signature
is `contents:signature`.
For sorting purposes, fields with numeric values sort in numeric
order (`objectsize`, `authordate`, `committerdate`, `taggerdate`).