vscode-diff-merge icon indicating copy to clipboard operation
vscode-diff-merge copied to clipboard

Is there a command I can use to start a diff-merge between the current file and another one?

Open GitMensch opened this issue 4 years ago • 11 comments

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": []
	},

GitMensch avatar Jan 04 '22 14:01 GitMensch

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).

GitMensch avatar Jan 04 '22 15:01 GitMensch

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

?

moshfeu avatar Jan 15 '22 21:01 moshfeu

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}"

GitMensch avatar Jan 15 '22 21:01 GitMensch

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 ❤️

moshfeu avatar Jan 26 '22 21:01 moshfeu

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.

stale[bot] avatar Mar 28 '22 00:03 stale[bot]

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: @.***>

moshfeu avatar Apr 07 '22 04:04 moshfeu

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.

GitMensch avatar Apr 07 '22 05:04 GitMensch

I'll try configure it. Thanks :)

moshfeu avatar Apr 07 '22 09:04 moshfeu

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 !

dsauval avatar May 31 '22 17:05 dsauval

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.

stale[bot] avatar Jul 30 '22 18:07 stale[bot]

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.

GitMensch avatar Jul 30 '22 18:07 GitMensch

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.

stale[bot] avatar Sep 30 '22 22:09 stale[bot]