Skip to content

issues when parsing git diff #79

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

Closed
luyijingxiu opened this issue May 21, 2020 · 4 comments
Closed

issues when parsing git diff #79

luyijingxiu opened this issue May 21, 2020 · 4 comments

Comments

@luyijingxiu
Copy link

luyijingxiu commented May 21, 2020

Describe the bug

  1. When parsing git diff like this
diff --git a/test/Issue.java b/test/Issue.java
new file mode 100644
index 00000000..9702606e

UnifiedDiffReader will throw UnifiedDiffParserException: "expected file start line not found"
I have analyze the code and found that new file mode 100644 can't not be recognized. But I found regex that can recognized this line in comment of method UnifiedDiffReader#parse()

// schema = [[/^\s+/, normal], [/^diff\s/, start], [**/^new file mode \d+$/**, new_file], 

It seems that you intend not to recognize this, Could you please tell the reason?

  1. The java.util.logging.Logger in UnifiedDiffReader is kind of chatty, How should I turn it off.

  2. Is UnifiedDiffUtils.parseUnifiedDiff() designed to only parse the first patch?

@wumpz
Copy link
Collaborator

wumpz commented May 21, 2020

You now this new implementation of UnifiedDiffReader was some kind of feature driven. So what was needed was implemented.

This is simply missing. So I will look into it. By the way, pull requests are welcome.

@wumpz wumpz pinned this issue May 21, 2020
@wumpz
Copy link
Collaborator

wumpz commented May 23, 2020

UnifiedDiffUtils is the old implementation, that only read the first patch.

@wumpz
Copy link
Collaborator

wumpz commented May 23, 2020

I will change the logger.

@luyijingxiu
Copy link
Author

luyijingxiu commented May 27, 2020

thank you for your reply, Actually, I only need to know line numbers that was added by parsing the diff file. I have modified your code to fit my need. I will commit a PR when possible.

wumpz added a commit that referenced this issue Jun 21, 2020
open #85
@wumpz wumpz unpinned this issue Jun 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants