Skip to content

add support for reporting a binary file is in a conflicted state - #6072

Merged
outofambit merged 4 commits into
masterfrom
abstraction-for-binary-conflicts
Nov 1, 2018
Merged

outofambit merged 4 commits into
masterfrom
abstraction-for-binary-conflicts

Conversation

@shiftkey

@shiftkey shiftkey commented Nov 1, 2018

Copy link
Copy Markdown
Member

Overview

While I dig into #6063 about the Git internals, this PR helps to adapt the shape of the data returned by getStatus - using a number to represent the conflicted files isn't helpful for binary files, so I've created a new shape:

export type ConflictStatus =
  | {
      readonly kind: 'text'
      readonly conflictMarkerCount: number
    }
  | {
      readonly kind: 'binary'
    }

Description

  • This PR just adapts the existing code to the new shape of data - we're not surfacing binary conflicted files currently, and they'll continue to be marked as "resolved" in the app
  • I've not done any of the UI work around how this affects the conflict resolution flow, but there's a placeholder list entry now to support when we are able to bubble these up.
  • I'm not a fan of the throw new Error I've added in here to ensure an unrepresentable state is not encountered, but it'd be cool to maybe figure that out once I've gotten improve conflict detection for binary files #6063 ready for review
  • 38c3a2c converts AppFileStatus to string enums for readability, but it also results in a bit less JS being emitted because it no longer uses numbers for the backing store

Release notes

Notes: no-notes

@shiftkey shiftkey mentioned this pull request Nov 1, 2018
4 tasks done
@shiftkey shiftkey added the ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Nov 1, 2018
@shiftkey shiftkey added this to the 1.5.0 milestone Nov 1, 2018

@outofambit outofambit left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this makes sense and is a great next step on this. one request to remove the UI TODO but other than that i'm good with this

@shiftkey

shiftkey commented Nov 1, 2018

Copy link
Copy Markdown
Member Author

🍎

@shiftkey shiftkey assigned shiftkey and outofambit and unassigned shiftkey Nov 1, 2018
@outofambit
outofambit merged commit 6cfa767 into master Nov 1, 2018
@outofambit
outofambit deleted the abstraction-for-binary-conflicts branch November 1, 2018 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-review Pull Requests that are ready to be reviewed by the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants