git_message_trailers mishandles a trailer with empty value.
Open
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 10.6k
- Forks
- 2.7k
- PR merge metrics
- No merged PRs in 30d
Description
Given a message like this, in which the first trailer has an empty value:
This is a commit message.
EmptyTrailer:
Another: trailer
Last: trailer
git_message_trailers returns only two trailers. The value of the first is a newline character followed by the entire second line ("\nAnother: trailer").
By contrast, "git interpret-trailers" prints the 3 trailers as expected.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the git_message_trailers implementation and compare its parsing behavior with git interpret-trailers for the example message. Done when all three trailers are returned and the first has an empty value instead of consuming the next line; verify the behavior with a regression test for this case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100