Is there a command I can use to start a diff-merge between the current file and another one?
The intended place to add it is running a command in tasks.json which takes the files to diff-merge and ideally also options like "left and/or right write-protected" as arguments.
The current task definition I'd like to replaces looks like the following:
{
"label": "Compare against project",
// Note: the following 'works' but does not take the argument into account
// "command": "${command:workbench.files.action.compareFileWith} ${workspaceFolder}${pathSeparator}..${pathSeparator}${input:project}${pathSeparator}${relativeFile}",
"command": "${execPath}",
"args": [
"--diff",
"${file}",
"${workspaceFolder}${pathSeparator}..${pathSeparator}${input:project}${pathSeparator}${relativeFile}"
],
"isBackground": true,
"group": "none",
"problemMatcher": []
},
It seems this doesn't exist in general yet, so here's the first part: a feature request for a new command to diff-merge two arbitrary files, which are either passed as arguments or selected from the workspace. I'd suggest to always have the first be the "left" one, and the second the "right", if one would want to select only the left file the command could be called with an empty arg (for "select") and then an arg with a filename (so the right one will be fixed).
for a new command to diff-merge
Do you mean a code command line? Like
code path/to/file1 path/to/file2
The closest I got in another extension I made is
COMPARE_FOLDERS=DIFF code path/to/folder1 path/to/folder2
https://github.com/moshfeu/vscode-compare-folders#cli. I don't think I checked if I can make my own argument. Something like
code --diffmerge path/to/file1 path/to/file2
?
No, a command that can be executed from within vscode, like in the sample
"command": "${command:workbench.files.action.compareFileWith} ${workspaceFolder}${pathSeparator}..${pathSeparator}${input:project}${pathSeparator}${relativeFile}"
Thank you for the info! I'm not sure when I will have time to implement it but soon I hope. Feel free to implement it and creating PR ❤️
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Keep
On Thu, Apr 7, 2022, 1:57 AM stale[bot] @.***> wrote:
Closed #60 https://github.com/moshfeu/vscode-diff-merge/issues/60.
— Reply to this email directly, view it on GitHub https://github.com/moshfeu/vscode-diff-merge/issues/60#event-6383978768, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA4NFL3RPMV3REZJBNPMZFLVDYJFLANCNFSM5LHT5YJA . You are receiving this because you commented.Message ID: @.***>
Seems like the bot doesn't re-open so maybe reconfigure it (also the bot possibly can check for a label to know which issues to not look at) ... and reopen the issue manually.
I'll try configure it. Thanks :)
First, Diff & Merge is a great tool, thank you for taking the time to develop it !
I would also be interested to be able to directly open Diff & Merge from the command line. As you suggested, something like code --diffmerge path/to/file1 path/to/file2".
Would you happen to have documentation that could help me get started adding this feature ? Thanks !
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
hey bot, you're still bad-configured, this issue already was noted to be implemented. Note @dsauval - I'm not sure if/how it could be specified directly when starting vscode; I'm mostly interested in a command I can execute within vscode.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.