Re: [RFC/PATCH] Add interpret-trailers builtin
- From
Christian Couder <christian.couder@gmail.com>
- Date
- Nov 6, 2013, 09:23 UTC
- Message-ID
- <CAP8UFD0STna++2StV1RcT2bB83Lh_hFQU94A0y4ziovs61Z==A@mail.gmail.com>
- In-Reply-To
- <20131106.074355.225932577498673677.chriscool@tuxfamily.org>
On Wed, Nov 6, 2013 at 7:43 AM, Christian Couder <chriscool@tuxfamily.org> wrote:
Show 11 quoted lines
> Of course in the latter case, a command should probably be specified > to tell which value should be used with the key. > > For example: > > [trailer "signoff"] > key = "Signed-off-by:" > if_missing = append > command = echo "$GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>"' > > would append a s-o-b line only if there is no s-o-b already.
Sorry, I realize that I was wrong above. As the default for "if_exist" is "dont_repeat", the above would append a s-o-b if there is no s-o-b or if there is one but with a different value.
To append a s-o-b only if there is no s-o-b already, one would need to use:
[trailer "signoff"]
key = "Signed-off-by:"
if_exist = dont_append
if_missing = append
command = echo "$GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>"'Thanks, Christian.