Thanks to visit codestin.com
Credit goes to github.com

Skip to content

issues when parsing git diff #79

Closed
@luyijingxiu

Description

@luyijingxiu

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions