Remove "appendix" information from commit message #19
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
...similar to
git am
.Add a new field,
BodyAppendix
to PatchHeader.Modify
scanMessageBody
to return both the body and the appendix.Do this by keeping two string builders, and having it switch to the
appendix builder when it finds a
---
line.Handling the newlines at the end as expected requires moving things
around a bit.
First, we were trimming space from the line once to decide whether the
line was empty, and then trimming space again if we determined it
wasn't empty. This only needs to be done once.
Then, do all the trimming (both of whitespace and the prefix) first,
before deciding what to do about the line.
Add some tests to verify that it works as expected.
NB that this patch will separate out an "appendix" even from the
output of
git log
, which presumably has already been checked in. Ifthis is not the desired behavior, we could either:
Make the
---
check after trimming whitespace, but before trimmingthe indent, or
Pass in a boolean to tell scanMessageBody not to separate out
appendix material if we're calling from parseHeaderPretty.
Signed-off-by: George Dunlap george.dunlap@citrix.com