forked from martinvonz/jj
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
conflicts.rs: label conflict number and sides next to conflict markers
For example, ``` <<<<<<< Conflict 1 of 3 +++++++ Contents of side #1 left 3.1 left 3.2 left 3.3 %%%%%%% Changes from base to side #2 -line 3 +right 3.1 >>>>>>> ``` or ``` <<<<<<< Conflict 1 of 1 %%%%%%% Changes from base to side #1 -line 3 +right 3.1 +++++++ Contents of side #2 left 3.1 left 3.2 left 3.3 >>>>>>> ``` Currently, there is no way to disable these, this is TODO for a future PR. Other TODOs for future PRs: make these labels configurable. After that, we could support a `diff3/git`-like conflict format as well, in principle. Counting conflicts helps with knowing whether you fixed all the conflicts while you are in the editor. While labeling "side #1", etc, does not tell you the commit id or description as requested in martinvonz#1176, I still think it's an improvement. Most importantly, I hope this will make `jj`'s conflict format less scary-looking for new users. I've used this for a bit, and I like it. Without the labels, I would see that the two conflicts have a different order of conflict markers, but I wouldn't be able to remember what that means. For longer diffs, it can be tricky for me to quickly tell that it's a diff as opposed to one of the sides. This also creates some hope of being able to navigate a conflict with more than 2 sides. Another not-so-secret goal for this is explained in martinvonz#3109 (comment). The idea is a little weird, but I *think* it could be helpful, and I'd like to experiment with it.
- Loading branch information
Showing
11 changed files
with
210 additions
and
166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,10 +59,10 @@ fn test_obslog_with_or_without_diff() { | |
@ rlvkpnrz [email protected] 2001-02-03 08:05:10 66b42ad3 | ||
│ my description | ||
│ Resolved conflict in file1: | ||
│ 1 1: <<<<<<<resolved | ||
│ 2 : %%%%%%% | ||
│ 1 1: <<<<<<< Conflict 1 of 1resolved | ||
│ 2 : %%%%%%% Changes from base to side #1 | ||
│ 3 : -foo | ||
│ 4 : +++++++ | ||
│ 4 : +++++++ Contents of side #2 | ||
│ 5 : foo | ||
│ 6 : bar | ||
│ 7 : >>>>>>> | ||
|
@@ -111,10 +111,10 @@ fn test_obslog_with_or_without_diff() { | |
--- a/file1 | ||
+++ b/file1 | ||
@@ -1,7 +1,1 @@ | ||
-<<<<<<< | ||
-%%%%%%% | ||
-<<<<<<< Conflict 1 of 1 | ||
-%%%%%%% Changes from base to side #1 | ||
--foo | ||
-+++++++ | ||
-+++++++ Contents of side #2 | ||
-foo | ||
-bar | ||
->>>>>>> | ||
|
Oops, something went wrong.