Skip to content

FR: Show (first) location for a conflict #7512

@terrahornbeck378

Description

@terrahornbeck378

Is your feature request related to a problem? Please describe.

I'm often working with files which contain strings similar to conflict markers. This makes identifying the conflict position hard.

Describe the solution you'd like

It would help me if jj reports the line of a conflict somewhere, maybe when it reports the "filename 2-sided conflict" message but any place, additional flag or even a separate subcommand would help.

Reporting the location of the first conflict hunk would probably suffice as remaining conflicts can be detected by fixing the first and then re-runnng jj status or jj show which then will report the next conflict hunk location.

Sample message

$ mkdir testrepo
$ jj git init .
$ jj describe -m "a"
$ echo aaa > foo
$ jj new -m "c" -r @-
$ echo bbb >> foo
$ jj new -m "merge"  -r @-+
Working copy  (@) now at: tsmzpolo 050c8c1e (conflict) (empty) merge
Parent commit (@-)      : ywvpnlpx f2cc9539 b2
Parent commit (@-)      : oxlmorxq 02641930 b1
Added 0 files, modified 1 files, removed 0 files
Warning: There are unresolved conflicts at these paths:
foo    2-sided conflict on lines 2, 13, 27, 42, 373
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
                         NEW report locations of hunks
foo    2-sided conflict,  first on line 2
                          ^^^^^^^^^^^^^^^
                           ALTERNATIVE report only the first hunk

(obviously without the ^^^, NEW, ... comments

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions