Skip to content

Error parsing diff Expected "rename from ", but got "copy from si" #14

Closed

Description

@dubcanada

Hey,

While I was viewing one of my diffs for a commit I got a

Expected "rename from ", but got "copy from si"

This error occurred because I copied pretty much my entire file from one from to another (but did a few changes, so git diff returned...

similarity index 97%
copy from style.css
copy to common.css

Similarity index can also be copy, it's not restricted to just renaming.

I'll see if I can get a pull request done. But how do you generally handle multiple options? I can't seem to find any other example. For now I just wrapped it in a try catch.

Activity

  1. alexandresalome commented on Jan 17, 2013

    @alexandresalome
    Member

    By now, diff command is executed by default with some parameters to detect copies and renames. Those should be options in Diff constructor and passed to ->run(...) properly.

    This problem needs to be addressed in two parts:

    1. Modify the Diff object to accept parameters for the strategy (detect renames, copies, white spaces and so on)
    2. Modify the DiffParser to tolerate all possible outputs.
  2. removed this from the milestone on Jun 23, 2019
  3. added a commit that references this issue on Sep 7, 2026
    f17e2a2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions