-
Notifications
You must be signed in to change notification settings - Fork 5
add missing eof line support #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
HI, @zmully Thanks for fixing it!
I don't actually have any use for this in the parsed output, but discovered this issue when I was experimenting with your library. I'm also not sure if this is the only git diff line that uses the \ character, the git docs are rather sparse on this matter.
After a quick check of the git source, it seems that the "" character is always followed by a "No newline at end of file" message. But I thinks it would be great if we use general type value such as "Message" for the handling other messages we might miss.
{
type: "Message",
content: "No newline at end of file"
}
Thanks @yeonjuan for the quick review and feedback! I've updated the PR with your feedback and added the missing README section I didn't catch the first time around. Thanks for putting together this library, it is super useful, and helped me put together an internal tool to parse out stringified JSON (like usually seen in IAM policy declarations) in diffs and redisplay the changes in a format that makes reviewing changes easier and less error prone.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!, Thanks for contribution!
Adds support for missing eof marker in git diffs. Without this, the parser will only parse the diff up to the first instance of this marker in the diff.
@yeonjuan I don't actually have any use for this in the parsed output, but discovered this issue when I was experimenting with your library. I'm also not sure if this is the only git diff line that uses the
\
character, the git docs are rather sparse on this matter.