Open TheClams opened 5 years ago
Yes, please.
When I first saw Sublime Merge announcement, I was over the moon thinking that there is finally a viable alternative to outdated $250 two/three-way diff & merge tool that I use regularly (on macOS).
If you could somehow extend Sublime Merge functionality, so that it could be used outside of version control repositories for diff/merge operations — I'd gladly pay extra for such extension. Though to be useful in my case, it has to support directory diff.
This would definitely be a big selling point. Beeing able to use it for all kind of merge/comparison operations would just remove the need for another inferior tool.
This also allows it to be used with git mergetool
and git difftool
.
I do not know how well it works, but @sonOfRa has a Gist to do that.
Also, can we have a full file side-by-side diff please? Bonus points for mini-map.
When I saw the name, SublimeMerge, I assumed it was product in the merge category like Araxis Merge, WinMerge, P4Merge, DiffMerge etc all of which merge files and have nothing to do with version control.
Maybe that's my bad for originally mis-understanding the product (a git front end, not merge software). But, I'd love better merge software. I use Slickedit's built in merge all the time as it allows comparing entire trees and merging in either direction and also marks if I've visited a file or not so I have some idea which files I've checked. One thing I really like about Slickedit's merge is that both sides are live so if I see a minor issue in the diff I can fix it right there, remove some white space, add a missing semicolon, etc.., without having to switch apps. Of course I can keep using other software but given the diffing code is in SublimeMerge it seems a natural thing for it to support this use case? (or I guess you're just reading git's diff output in which case maybe not?) Or maybe you could fork, it, rename this SublimeGit and actually make a SublimeMerge to compete with other merge software?
+1
I've been using Araxis Merge for 10+ years. I'd love to have a Sublime replacement.
Does Sublime Merge currently support opening an arbitrary .diff file to take advantage of the great side-by-side syntax highlighting? This would be very convenient for viewing patch files without needing to apply the patch to a repo first.
I'm not sure if what I described should be a stand-alone feature request or if it's baked into this one.
For what it's worth, this is all I want out of Sublime Merge. If I could use it as a git mergetool
, you would have my money today.
Hi all,
Just a quick update - in the latest dev build of Sublime Merge (1105), we've added a mergetool mode for smerge (the command line tool). It currently works on Linux and MacOS, with Windows support to come in the next build.
For details, see smerge --help
@dpjohnst How would one configure this to work with git-difftool
? I've tried the following:
[diff]
tool = sublime_merge
[difftool "sublime_merge"]
trustExitCode = true
cmd = smerge mergetool \"$BASE\" \"$LOCAL\" \"$REMOTE\" -o \"$MERGED\"
$ git init
Initialized empty Git repository in /private/tmp/tmp.gmSsqFnrui/.git/
$ mkdir foo
$ echo baz > foo/bar
$ git add foo/
$ git commit -am blah
[master (root-commit) 9a4d664] blah
1 file changed, 1 insertion(+)
create mode 100644 foo/bar
$ echo bax > foo/bar
$ git commit -am blahblah
[master ccafdc7] blahblah
1 file changed, 1 insertion(+), 1 deletion(-)
$ git difftool --dir-diff HEAD^ -- foo/
But I get the following error:
Any ideas?
You might need a --wait before mergetool in your command
@dpjohnst Take my money
@TheClams Nice tip! Note that -w/--wait
is not a documented option in the output of smerge --help
, but seems to be supported:
$ smerge --help
Sublime Merge build 1105
Usage: smerge path Open the given repository
or: smerge search query Search for commits in the current repository
or: smerge blame file [line] Blame the given file in the current repository
or: smerge log file Show the file history in the current repository
or: smerge mergetool [base] left right [-o merged] Opens the merge tool for the given files
-n or --new-window: Open a new window
-b or --background: Don't activate the application
-h or --help: Show help (this message) and exit
-v or --version: Show version and exit
That said, I think the issue is also that smerge
doesn't (yet?) support diffing directories (i.e. --dir-diff
). Seems to work when I exclude the --dir-diff
option.
[edit] Looks like --wait
is no longer needed in Build 1106+:
Is this working in windows now too?
Hi @TheEggi,
As of the latest development build, this feature is supported on all platforms.
There seems to be a bug with argument parsing, calling the mergetool like its documented will try to find a git repo in the applications path (and above). Look at the call below and the strace output:
strace smerge mergetool ./package/glibc/glibc.mk ./package/glibc/glibc.mk ./package/glibc/glibc.hash -o /tmp/xx
stat("/usr/bin/smerge/.git", 0x7ffd3ed8d2e8) = -1 ENOTDIR (Not a directory)
stat("/usr/bin/smerge/.git", 0x7ffd3ed8d2e8) = -1 ENOTDIR (Not a directory)
stat("/usr/bin/smerge/config", 0x7ffd3ed8d198) = -1 ENOTDIR (Not a directory)
stat("/usr/bin/.git", 0x7ffd3ed8d2e8) = -1 ENOENT (No such file or directory)
stat("/usr/bin/.git", 0x7ffd3ed8d2e8) = -1 ENOENT (No such file or directory)
stat("/usr/bin/config", 0x7ffd3ed8d198) = -1 ENOENT (No such file or directory)
stat("/usr/.git", 0x7ffd3ed8d2e8) = -1 ENOENT (No such file or directory)
stat("/usr/.git", 0x7ffd3ed8d2e8) = -1 ENOENT (No such file or directory)
stat("/usr/config", 0x7ffd3ed8d198) = -1 ENOENT (No such file or directory)
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0x1), ...}) = 0
brk(0x1b60000) = 0x1b60000
write(1, "Unable to find a git repository "..., 51Unable to find a git repository at /usr/bin/smerge
What does work correctly, is adding any path as another argument:
strace smerge mergetool ./package/glibc/glibc.mk ./package/glibc/glibc.mk ./package/glibc/glibc.hash -o /tmp/xx /some/phantasy/path
Build is Sublime Merge Build 1107
on Linux x86_64 (Debian 10)
There seems to be an issue with the windows version. Somehow it tries to add the current path to the parameters - not sure if there is a way to work around this issue:
Following command is not working:
smerge mergetool "D:\new_folder_4/1.tps" "D:/new_folder_4/2.tps"
Error message:
---------------------------
Sublime Merge
---------------------------
Error reading file: C:\D:\new_folder_4\1.tps
---------------------------
OK
---------------------------
I tried to add a "/" in front of the paramater, which would lead to the following command:
smerge mergetool "/D:\new_folder_4/1.tps" "/D:/new_folder_4/2.tps"
Afterwards it seems to not add the current directory anymore, but the path itself is incorrect (as expected).
---------------------------
Sublime Merge
---------------------------
Error reading file: D::\new_folder_4\1.tps
---------------------------
OK
---------------------------
Edit: This issue is now fixed in 1108. Thank you for fixing it! Only thing left now is the difftool/2 way diff for it to be a complete replacement to other tools.
Are there plans to support diffing directories?
@nolange thanks for the report! This has been fixed as of build 1109.
@TheEggi thank you for the report also! As you've noted this has been fixed as of build 1108.
@nikitaourazbaev currently we haven't got any plans to support directory diffing, however this may change in the future. If you haven't already, I suggest putting up a feature request on this issue tracker :)
@dpjohnst this feature request is about diffing non-git files (and directories) ;)
+1 on this, first class support for git difftool would be tops, it's the one thing that's keeping smerge from being basically a perfect git gui for me.
I don't think a merge tool is the correct answer to this issue, at least that's not what first comes to my mind when i try to diff two files. What i expect is a simple diff, with the possibility to copy or save it.
What about sublimerge? it does diff of files/clipboard/selection and all within sublime text (you do not need to launch SM in order to diff 2 files)
Subscribed to this issue update, personally, very much looking forward to Sublime Merge adding a local file comparison feature.
Has there been any update on this feature? for folder diff
There's barely any update to the app, let alone new features. I'm worried this will become abandonware 🤷🏽
There's barely any update to the app, let alone new features. I'm worried this will become abandonware 🤷🏽
On Discord, Dylan said there's stuff coming. I don't know which things he might be speaking about, but it's not abandoned.
Problem description
There is no diff/merge tool with proper syntax highlighting like SublimeMerge, but it can only works in a git environment. There is a lot of non-git cases where diff/merge is required The name SublimeMerge put emphasis on Merge not Git, so allow the tools to be used in situation where there is no git repository.
Preferred solution
Support a simple command-line option like : "smerge base mine others". This would make it easy to call SublimeMerge from other revision control tools.
Alternatives
And an even greater upgrade would be to allow diff/merge directly on two directories,