allow diff.branch between unrelated branches
#5982
Merged
+59
−13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR lifts the restriction in
diff.branchthat disallows diffing branches that don't share a history. We had always planned to handle this case by effectively setting the LCA to the first argument, however the restriction was originally added for performance reasons, as the implementation in this PR isn't efficient (it just sets the causal hash of the LCA, and then proceeds with the rest of the algorithm, which will end up doing unnecessary work in several places). Nonetheless, it now seems like a better idea to just do the inefficient thing and follow up with a more efficient thing soon.Test coverage
Transcripts and manual testing
Loose ends
More efficient implementation in progress