Skip to content

Use VS Code 3 Way Merge Editor as git merge tool #153340

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
hediet opened this issue Jun 27, 2022 · 3 comments
Closed

Use VS Code 3 Way Merge Editor as git merge tool #153340

hediet opened this issue Jun 27, 2022 · 3 comments

Comments

@hediet
Copy link
Member

hediet commented Jun 27, 2022

This should be supported:

git config --global merge.tool vscode
git config --global mergetool.vscode.cmd 'code --merge $BASE $LOCAL $REMOTE $MERGED'

So that in a case of a merge conflict

git mergetool

Can be used.

@hediet hediet added feature-request Request for new features or functionality merge-editor labels Jun 27, 2022
@hediet hediet added this to the July 2022 milestone Jun 27, 2022
@jrieken
Copy link
Member

jrieken commented Jun 27, 2022

Yeah, that should be similar to the --wait command line flag that we already have

@bpasero
Copy link
Member

bpasero commented Jun 28, 2022

💯

I think this is a duplicate of #5770

This probably needs a combination of --wait on the result file and support to pass in an argument to enforce opening the merge editor. We do something similar with --diff so I would try to go from there: with --diff you pass in 2 paths and we end up opening a diff editor instead of opening the 2 paths as editors separately.

readonly filesToDiff?: IPathData[];

We need to handle this request both for when a new window opens as initial editors to open but also when opening into an existing window, which is the more typical case for when using git while VSCode is already running:

const initialFilesToOpen = this.getInitialFilesToOpen();

ipcRenderer.on('vscode:openFiles', (event: unknown, request: IOpenFileRequest) => this.onOpenFiles(request));

A little challenge is that merge editor is a contrib while handling of arguments currently does not have a contribution model so we might want to think about moving the merge editor to core or would have to add a hack to call a contributed command.

@joaomoreno
Copy link
Member

Let's use #5770 for this, so all those people get pinged.

@joaomoreno joaomoreno closed this as not planned Won't fix, can't repro, duplicate, stale Jul 5, 2022
@hediet hediet removed the feature-request Request for new features or functionality label Jul 26, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Aug 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants