Skip to content

Commit.getDiff is backwards? #368

Description

@orderedlist

Using commit.getDiff in a recent project, and the diff I'm getting appears to be the reverse of what is expected. It would seem that this line...

return thisTree.diff(parentTree);

should in fact be

return parentTree(thisTree);

Mostly because, in my expectation, getDiff would give me the changes made in that commit from the previous, not the changes required to undo the commit.

Basically, I believe the current method is performing something like

git diff sha..parent

when I would expect

git diff parent..sha

Am I reading this right, or am I just going crazy? If I'm right, I can put in a PR to fix, I just wanted to make sure I'm understanding before I put in the change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions