Skip to content

Conversation

@BinaryMuse
Copy link
Collaborator

@BinaryMuse BinaryMuse commented Dec 3, 2018

This is an attempt to fix #10.

This technically works, but I don't love it for a couple reasons:

  • The similarity field only shows up if the parser detects that the diff includes a rename or copy. We could include this in all return values and just set it to null, but the field doesn't make sense outside of the context of a copy.
  • The binary field is usually true or false, but in this case, we don't actually know if the file is binary or not, so I opted to set this to null.
  • Both modes are set to null, which typically can be used to determine if a file is created or deleted, but like binary, don't make sense in this context.

One option is to return different concrete and documented types for the various kinds of diffs, but that feels like a semver-major change.

If folks have 💭s, please feel free to share!

/cc @kuychaco, @kytwb, @smashwilson, @annthurium

BinaryMuse and others added 6 commits December 3, 2018 11:44
We don't get this info from Git for re-names. It felt funky to say that the modes were null when the files actually have modes, we just don't know what they are. Plus, we use a null file mode to indicate that the file does not exist for created/deleted files.

Co-authored-by: Michelle Tilley <[email protected]>
Co-authored-by: Michelle Tilley <[email protected]>
@kuychaco kuychaco merged commit 1ffadff into master Dec 19, 2018
@kuychaco kuychaco deleted the mkt/handle-renames-copies branch December 19, 2018 01:45
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

Successfully merging this pull request may close these issues.

Crash on rename in diff

3 participants