Re: Parsing trailers
- From
Christian Couder <christian.couder@gmail.com>
- Date
- Dec 26, 2018, 04:33 UTC
- Message-ID
- <CAP8UFD2A1tX9qPZXr8ibPhy0B1zc5OtsWzP_XHoRJJF6hmkxRQ@mail.gmail.com>
- In-Reply-To
- <CAFW+GMB4KW34qaOWNwShWM_ERSJtnvp86V_mFAse1biO=T-srw@mail.gmail.com>
Hi William,
On Mon, Dec 24, 2018 at 7:52 PM William Chargin <wchargin@gmail.com> wrote:
Show 8 quoted lines
> > Hi Christian: thanks for your reply. > > > Changing the default separator as shown above, should make it easier > > to parse the result. > > But this actually also changes which lines are considered trailers, > right?
Yes.
Show 8 quoted lines
> If the commit message ends with > > Signed-off-by: one > Signed-off-by| two > > and the user’s `trailer.separators` is set to `:`, then the correct > result should be only `Signed-off-by: one`. But when adding `|` as a > separator, we also see `Signed-off-by: two` in the result.
Yeah, but you can perhaps check that the input doesn't contain '|' before doing the above. If it does contain '|' then you can probably find another char that it doesn't contain and use that char instead of '|'.
Another solution would be to develop a trailer.outputseparator config option, which should not be very difficult.
Best, Christian.