vscode: Merge editor doesn't open with REBASE_HEAD

Issue Type: Bug

Open add/add conflict file.

git.mergeEditor: true image

git.mergeEditor: false image

Neither is terribly useful, frankly.

VS Code version: Code - Insiders 1.69.0-insider (0e3304bca9e862eddc7e437e2bab8a4a4a4f33c9, 2022-06-29T05:20:28.364Z) OS version: Windows_NT x64 6.1.7601 Restricted Mode: No

System Info
Item Value
CPUs Intel® Core™ i5-3550 CPU @ 3.30GHz (4 x 3292)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 15.96GB (10.20GB free)
Process Argv D:\Profiles\anrdaemon\Documents\.github\Otus --crash-reporter-id 6d7cf40a-de80-4f22-8c48-92868c2e08dd
Screen Reader no
VM 0%
Extensions: none
A/B Experiments
vsliv695:30137379
vsins829:30139715
vsliv368cf:30146710
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
pythonvspyl392:30422396
pythontb:30258533
pythonptprofiler:30281269
vshan820:30294714
pythondataviewer:30285072
vscod805:30301674
bridge0708:30335490
bridge0723:30353136
vsaa593cf:30376535
pythonvs932:30404738
wslgetstarted:30449409
vscscmwlcmt:30465136
cppdebug:30492333
vscaac:30438845
pylanb8912:30496796
vsclangdf:30492506

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 6
  • Comments: 26 (8 by maintainers)

Commits related to this issue

Most upvoted comments

[Window Title]
Visual Studio Code - Insiders

[Main Instruction]
Visual Studio Code - Insiders

[Content]

Version: 1.70.0-insider (system setup)
Commit: 3cbf3063281410d21951877eb628551809d70c6b
Date: 2022-07-25T05:27:52.229Z (2 hrs ago)
Electron: 18.3.5
Chromium: 100.0.4896.160
Node.js: 16.13.2
V8: 10.0.139.17-electron.0
OS: Windows_NT x64 6.1.7601

[OK] [Copy]

Still no go. An attempt to open conflicting file produces error in Log (Window):

[2022-07-25 10:52:52.278] [renderer1] [error] Unsupported input: Error: Unsupported input
    at createTextEditor (vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code%20Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:2749:8903)
    at P.openEditor (vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code%20Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:2749:24527)

@jnugh This has landed in insiders. You can help us verifying that this works, see the hint above ⬆️

Yeah they both do. I just spun up a local vscode build to get better debugging capabilities and actually found the cause in my case.

resolveChangeCommand currently checks for resource.type === Status.BOTH_MODIFIED in my case the Status is BOTH_ADDED.

Finally - Steps to reproduce:

git init
touch unrelatedfile
git add unrelatedfile
git commit -m "INITIAL COMMIT"
git checkout -b branch1
echo "data" > file
git add file
git commit -m "Add file"
git checkout main
git checkout -b branch2
echo "atad" > file
git add file
git commit -m "Add file"
git merge branch1

Changing the condition to

const bothAddedOrModified = resource.type === Status.BOTH_MODIFIED || resource.type === Status.BOTH_ADDED;

worked in my case. Not sure if this is sufficient though. I would not have thought about checking for BOTH_ADDED so maybe there are even more cases.

I’m not sure if this is the same issue as the previous git status output looked more like being in a usual merge state but maybe this still helps.

For me this happens during rebase. It works for the first file (sometimes?) and logs the following for the following files:

[2022-07-14 14:04:48.606] [renderer1] [error] [Extension Host] FAILED to read HEAD, MERGE_HEAD commits
[2022-07-14 14:06:30.966] [renderer1] [error] Unable to read file 'git:/c:/Users/x/Documents/Code/y/src/app/components/z/z.component.html?{"path":"c:\\Users\\x\\Documents\\Code\\y\\src\\app\\components\\z\\z.component.html","ref":":3"}' (Error: File not modified since): Error: Unable to read file 'git:/c:/Users/x/Documents/Code/y/src/app/components/z/z.component.html?{"path":"c:\\Users\\x\\Documents\\Code\\y\\src\\app\\components\\z\\z.component.html","ref":":3"}' (Error: File not modified since)
    at h.doReadFileStream (vscode-file://vscode-app/c:/Users/x/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:602:20036)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async p.doRead (vscode-file://vscode-app/c:/Users/x/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:2752:42357)
    at async p.readStream (vscode-file://vscode-app/c:/Users/x/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:2752:42032)
    at async Ir.resolveFromFile (vscode-file://vscode-app/c:/Users/x/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:2741:66789)
    at async vscode-file://vscode-app/c:/Users/x/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:2752:36489

In case of a rebase REBASE_HEAD should be used instead of MERGE_HEAD I think.