-
Notifications
You must be signed in to change notification settings - Fork 281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proof of concept: structured diff of conflicted commits #4251
base: main
Are you sure you want to change the base?
Commits on Sep 16, 2024
-
lib
merge
: extract get_simplified_mapping and co.These will be used for diffs of Merge-s. This also refactors one of the less important tests. I did it mostly automatically with `ast-grep` (which I don't necessarily recommend), but we could also just delete this test I think.
Configuration menu - View commit details
-
Copy full SHA for 226ce13 - Browse repository at this point
Copy the full SHA 226ce13View commit details -
lib get_simplified_mapping: change algorithm slightly
This reorders the result slightly and makes it easier to generalize this to work on diffs of merges (where there is the same number of adds and removes).
Configuration menu - View commit details
-
Copy full SHA for db2807c - Browse repository at this point
Copy the full SHA db2807cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8f3c51f - Browse repository at this point
Copy the full SHA 8f3c51fView commit details -
lib
merge
: add DiffOfMerge typeThis represents a diff of two merges, up to reordering and cancelling out of terms. It can also be thought of as a stack of `n` diffs. This type is not very suitable for presenting to the user (since it loses information they might want to see), but is very natural from the perspective of conflict theory.
Configuration menu - View commit details
-
Copy full SHA for a1286f3 - Browse repository at this point
Copy the full SHA a1286f3View commit details -
lib
merge
: function to optimize diffs of merges wrt a distance func……tion For textual conflicts, the distance function will be the size of the diff between two chunks of text.
Configuration menu - View commit details
-
Copy full SHA for f67b150 - Browse repository at this point
Copy the full SHA f67b150View commit details -
lib
merge
: the keyexplain_diff_of_merges
function and data struc……ture This turns two Merge-s into an object that represents a way to present their difference to the user, in the form of `Vec<DiffExplanationAtom>`. `DiffExplanationAtom` is the key structure for the data model of differences between diffs. The algorithm is inefficient and far from perfect, for now my focus is on the data model.
Configuration menu - View commit details
-
Copy full SHA for 34003a9 - Browse repository at this point
Copy the full SHA 34003a9View commit details -
lib
file
: Refactor merge of file hunksThe goal here is to create a single operation to split a conflicted file text into a sequence of (potentially conflicted) hunks, both for regular conflicts and conflict diffs. The new algorithm is not efficient and I'm guessing an algorithm that gives better results (more logical hunks) is possilbe. We may want to instead keep the conflicts and conflict diff code path separate until the algorithm improves, let me know.
Configuration menu - View commit details
-
Copy full SHA for e5262d8 - Browse repository at this point
Copy the full SHA e5262d8View commit details -
Configuration menu - View commit details
-
Copy full SHA for fe554c5 - Browse repository at this point
Copy the full SHA fe554c5View commit details -
cli
diff-util
: implementdiff --structured-conflicts
This works with all the places diffs are shown, e.g. `jj diff`, `jj log -p`, `jj interdiff`, etc.
Configuration menu - View commit details
-
Copy full SHA for 173623b - Browse repository at this point
Copy the full SHA 173623bView commit details -
indent added/removed diffs with
+|
or-|
I initially tried just `+` and `-`, but that seemed confusing. The color helps, but I think this is ~understandable either way
Configuration menu - View commit details
-
Copy full SHA for aa4d58e - Browse repository at this point
Copy the full SHA aa4d58eView commit details -
Configuration menu - View commit details
-
Copy full SHA for ef9952c - Browse repository at this point
Copy the full SHA ef9952cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 377ae1c - Browse repository at this point
Copy the full SHA 377ae1cView commit details -
Configuration menu - View commit details
-
Copy full SHA for e5ed546 - Browse repository at this point
Copy the full SHA e5ed546View commit details