Repository navigation
handle renames in commit view - #577
Conversation
|
@niik which commit was this for? I'll add it to my test suite EDIT: oops, i see it's the same commit. let me go back to the raw Git output. |
|
Putting this back to [WIP] while I go find where these |
This code change also ensures we detect renames with an additional value for the percentage of content changed in the blob, e.g. R100, R084.
39f37c8 to
98698b8
Compare
|
I'm puzzled at how the I'm happy that the file list matches what we're displaying on dotcom (it's now displaying 55 files), and some tests now cover rename detections, and I'll open some issues to track the other inconsistencies between the history view and the changes view. |
98698b8 to
ae5f7f0
Compare
|
🍎 |
niik
left a comment
There was a problem hiding this comment.
I'm puzzled at how the CXXX values were creeping into this output from the initial repro.
@joshvera Is it possible, seeing as you're a diff pro these days that you have diff.renames set to copies in your global or local git config?
@shiftkey Can we add a test where we set that config flag so that we cover the rename scenario?
| case FileStatus.Renamed: return OcticonSymbol.diffRenamed | ||
| case FileStatus.Conflicted: return OcticonSymbol.alert | ||
| // TODO: we don't have an Octicon for when the diff is copied | ||
| case FileStatus.Copied: return OcticonSymbol.question |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
@niik I can test the EDIT: yup, it's that. I can suppress this by passing |
I haven't had a chance to get familiarized with this yet but is there any particular reason why we'd need to suppress it as opposed to handling it? |
We don't have a way within |
Right, I'm just saying we don't we respect the users configuration options in this case? We do, after all, go to some lengths to render staged renames. Since it seems to me like we have everything in place to deal with copies? Why explicitly forbid them? |
|
@niik two reasons come to mind
|
|
First off, this is all pretty academic, either option is certainly fine so I'm happy to turn it off for now and maybe addressing it in the future. I guess it just feels odd to have code to deal with something that we then try our damnedest to ensure never happens. It's sort of like how we had I'm fine with turning it off for now, I'll play out my argument below while I have it fresh in my mind.
Would it look different though? Aren't we just rendering them as added files now? Also, wouldn't this only happen to very pro-users of Git that sets this particular option?
I don't think that we should render copies any differently in the file list but preserving the state from Git could have some value for us. We will in all likelihood add a diff header that shows file name, rename info and potentially mode changes to the diffs anyway, that could be a place where we could surface this information if we wanted, something like |
|
@niik yeah, I'm not really fussed on either approach. I can verify we're handling copies with a test, drop the config override and discuss the UX side further. |
f4fce0f to
dedd2f8
Compare
|
🌔 |

Fixes #572
The underlying output from Git includes the rename detection percentage, as well as both file names when it is a rename: