microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
161.62k stars 28.39k forks source link

Provide way to open the merge editor even if the "source control" pane doesn't load #219611

Open jakebailey opened 1 month ago

jakebailey commented 1 month ago

Type: Feature Request

I'm fixing up old PRs; merging main leads to far too many changes for the Source Control pane to load. But, now I can't click on a conflicted file to be open it in the new merge editor. The only option I get are the inline buttons to accept specific changes, when I just really want the option that will let me accept the combination (the best merge editor feature).

VS Code version: Code - Insiders 1.91.0-insider (aea213b7fcc7de5c24ad797ac1af209b159d451f, 2024-06-28T05:56:20.804Z) OS version: Windows_NT x64 10.0.22631 Modes: Remote OS version: Linux x64 5.15.90.1-microsoft-standard-WSL2

jakebailey commented 1 month ago

For reference, I see:

image

No merge editor button, none of the palette buttons do the thing I'm looking for.

hediet commented 1 month ago

Glad to hear you like the merge editor! ❤ I think you can configure VS Code as merge tool in git (there are CLI options to pass base/input1/input2/result paths to VS Code). Then git merge tool (or a similar command) will open the merge editor of VS Code.

@lszomoru Can we do something here?

VSCodeTriageBot commented 1 month ago

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

lszomoru commented 1 month ago

@jakebailey, thanks for the screenshot. The "Source Control" view is being rendered by running git status and then parsing the output. Given the screenshot, what I am suspecting is that your are in a state in which running git status returns more than 10,000 entries hence we show a warning. Could you confirm that? Could you try setting the git.statusLimit setting to 0 in order to remove this limit. Did that help? Thanks!

Adding @chrmarti as well since he owns the merge conflict codelenses.

jakebailey commented 1 month ago

Setting "git.statusLimit": 0 allowed the source control page to load:

image

When opening a file manually in the editor, I now get the button bottom right:

image

And clicking on the conflicted file in the source control pane also works to open the merge editor.

Verifying without the setting, the source control page never loads and the button never appears, so my test case is at least good.

If you want to test this yourselves, I've pushed https://github.com/jakebailey/TypeScript/tree/merge-testing up; doing git merge main creates the 20000 file merge.


It sounds like I can leave this setting on; even when I set it to zero, the UI was responsive and working fine.

One thing I'm wondering here is whether or not it would be worth it for VS Code to instead use something like git diff --name-only --diff-filter=U or git diff --check to get a list of conflicting files, in the case where it can't parse out the status. But if setting the status limit to 0 to allow unlimited parsing works fine, that's also good and I'll keep using it in the meantime!

Offering the button on files with merge conflict markers would also be pretty helpful; that doesn't require any additional git parsing as VS Code already sees those markers and handles them for other UI...