Add parsing support for Signed-off-by lines in commit messages
The RevCommit.getFooterLines() methods now give us direct access to
the Signed-off-by, Acked-by, etc. footer lines in a commit message
body, making it easier to process this information in code.
The value of a SOB line is treated as an opaque string value. JGit
does not attempt to break it down into a sort of micro PersonIdent,
even though it is very typical for a SOB line to have a name and an
email address. Since this is very free-form text that a human can
modify when creating a commit object we can't make nearly the same
assumptions about uniformity of value as we can make when parsing
the machine generated commit headers.
To avoid unnecessary byte[] to String conversions we delay the
conversion of a key or a value section of a footer line until the
last possible moment in the application code. This way we don't
spend time converting text for footer lines that the application
doesn't care to see. We also can avoid allocating unnecessary
String objects if the application won't care about that particular
footer line value.
The FooterKey object can be used to more efficiently filter out
the footer lines, by using an optimized byte equality test and
avoiding String conversions. Standard instances for the common
footers like Signed-off-by are supplied as constants, making it
easier for applications to read footers.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>