sublimehq / sublime_merge

Issue tracker for Sublime Merge
https://www.sublimemerge.com
273 stars 14 forks source link

Diff editing mode #1939

Open cormacrelf opened 1 week ago

cormacrelf commented 1 week ago

Problem description

I've been trying out Jujutsu / jj. It uses git to store commits, and you can use Sublime Merge in a "colocated" git/jj repo with no problems and I have been for the last week. SM works perfectly as a commit browser & also as a mergetool from the command line. I'm not asking for any extensive JJ integration, because it's too young.

However, there is one isolated feature I think SM could add, along the lines of smerge mergetool, that would not require actual JJ integration, and would also be useful for regular Git users.

The feature is known as "3-pane diff editing". It's very similar to acting as a mergetool. The best overview of diff editing is in the diffedit3 readme. Docs on configuring a tool for it are here and this is where they configure command line args for Meld.

As you can see, this is basically like the git staging area but using temp directories, and without the option to "discard". This kind of thing is, in my opinion, SM's greatest strength as a git client. SM's staging area and mergetool are the best there is. I think you could combine them and be the best diff editor.

Preferred solution

SM could add a smerge diffedit command.

SM's commit/staging area UI is way more efficient than what Meld does here. Meld's is pretty lame -- you are initially shown three identical-looking filesystem trees, you have to double click on a file to see any diffs, and you can only look at one file at a time in full screen. So I kinda think you could just reproduce the SM commit/staging area UI without "discard" or "commit" buttons, and drop into 3-pane mode for a file if you click on an "edit" button, scrolled to the hunk you clicked it on.

I think you could also bring this feature to git users:

Alternatives

Don't

Screenshots

This is diffedit3. Looks like a mergetool, really. You can see it has multiple files to look at.

image