vscode icon indicating copy to clipboard operation
vscode copied to clipboard

`vscode-merge-base` is duplicated sometimes

Open nZeus opened this issue 8 months ago • 3 comments

Type: Bug

Sometimes the vscode-merge-base setting is added multiple times for the same branch, causing other tools (Nuke) to fail. I guess there is no check here https://github.com/microsoft/vscode/blob/d9909effe9501207aae7846917a559bbcb98948c/extensions/git/src/repository.ts#L1552 if the value has already been set

Image

VS Code version: Code 1.98.2 (Universal) (ddc367ed5c8936efe395cffeec279b04ffd7db78, 2025-03-12T13:32:45.399Z) OS version: Darwin arm64 24.3.0 Modes:

System Info
Item Value
CPUs Apple M2 Max (12 x 2400)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
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_graphite: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) 26, 29, 18
Memory (System) 32.00GB (0.08GB free)
Process Argv /Users/iliatsvetkov/Repos/workflows-2 --crash-reporter-id c0898da9-5733-479d-b3df-367da3b0a819
Screen Reader no
VM 0%
Extensions (82)
Extension Author (truncated) Version
vscode-openapi 42C 4.32.2
Bookmarks ale 13.5.0
toggle-excluded-files amo 2.0.0
markdown-checkbox bie 0.4.0
mermaid-markdown-syntax-highlighting bpr 1.7.0
vscode-markdownlint Dav 0.59.0
vscode-eslint dba 3.0.10
githistory don 0.6.20
xml Dot 2.5.1
overtype DrM 0.5.0
gitlens eam 16.3.3
EditorConfig Edi 0.17.2
elm-ls-vscode elm 2.8.0
vscode-todo-plus fab 4.19.1
dotnet-test-explorer for 0.7.8
html-preview-vscode geo 0.2.5
vscode-github-actions git 0.27.1
vscode-pull-request-github Git 0.106.0
gc-excelviewer Gra 4.2.63
terraform has 2.34.3
vscode-test-explorer hbe 2.22.1
vscode-drawio hed 1.9.0
npm-dependency-links her 1.3.0
rest-client hum 0.25.1
latex-workshop Jam 10.9.0
vscode-edit-csv jan 0.11.3
svg joc 1.5.4
vscode-map-preview jum 0.7.0
favorites kdc 2.4.5
graphql-for-vscode kum 1.15.3
contextualduplicate laf 0.2.0
csharp-colors log 0.2.1
tgit-cmds mbi 1.4.2
vscode-github-actions me- 3.0.1
rainbow-csv mec 3.18.0
git-graph mhu 1.30.0
prettify-json moh 0.0.3
vscode-docker ms- 1.29.4
blazorwasm-companion ms- 1.1.4
csdevkit ms- 1.17.64
csharp ms- 2.70.15
dotnet-interactive-vscode ms- 1.0.6177010
dotnet-maui ms- 1.9.21
vscode-dotnet-runtime ms- 2.3.0
vscodeintellicode-csharp ms- 2.2.3
data-workspace-vscode ms- 0.6.0
mssql ms- 1.29.1
sql-bindings-vscode ms- 0.4.0
debugpy ms- 2025.4.1
isort ms- 2023.10.1
python ms- 2025.2.0
vscode-pylance ms- 2025.3.2
jupyter ms- 2025.2.0
jupyter-keymap ms- 1.1.2
jupyter-renderers ms- 1.1.0
vscode-jupyter-cell-tags ms- 0.1.9
vscode-jupyter-slideshow ms- 0.1.6
remote-containers ms- 0.401.0
remote-wsl ms- 0.88.5
hexeditor ms- 1.11.1
powershell ms- 2025.0.0
test-adapter-converter ms- 0.2.1
vsliveshare ms- 1.0.5948
vscode-paste-image mus 1.0.4
vscode-markdown-plantuml-preview mym 0.0.2
copy-file-name nem 1.2.0
vetur oct 0.37.3
vscode-versionlens pfl 1.16.3
geo-data-viewer Ran 2.6.0
vscode-yaml red 1.17.0
bash-debug rog 0.3.9
zsh-debug rog 0.1.3
markdown-preview-enhanced shd 0.8.18
vscode-taskexplorer spm 2.13.2
lua sum 3.13.9
rest-book tan 6.2.1
pdf tom 1.2.2
luna-paint Tyr 0.16.0
hammerspoon vir 0.5.2
vscode-icons vsc 12.11.0
markdown-all-in-one yzh 3.6.3
markdown-editor zaa 0.1.13

(1 theme extensions excluded)

A/B Experiments
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805cf:30301675
binariesv615:30325510
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyone:30548225
vscrp:30673768
962ge761:30959799
h48ei257:31000450
pythontbext0:30879054
cppperfnew:31000557
dwnewjupytercf:31046870
nativerepl2:31139839
pythonrstrctxt:31112756
nativeloc2:31192216
iacca1:31171482
5fd0e150:31155592
dwcopilot:31170013
6074i472:31201624
dwoutputs:31242946
customenabled:31248079
9064b325:31222308
copilot_t_ci:31222730
850i5325:31264362
e5gg6876:31270012
jda6j935:31233686
pythoneinst12cf:31262606
bgtreat:31268568
fh1c7952:31258891
4gafe986:31264396
31787653:31262186
3e8i5726:31266632
49da9784:31264548

nZeus avatar Mar 28 '25 10:03 nZeus

Is there any update regarding this issue?

RigijAselo avatar May 22 '25 09:05 RigijAselo

@nZeus, @RigijAselo, are you able to reproduce this issue? Could you please share steps? Thanks!

lszomoru avatar May 23 '25 18:05 lszomoru

For me, it happens "randomly". Last time it happened, I did the following:

  • Pulled a branch dev locally.
  • Created a new branch derived-from-dev
  • Pushed the new branch to origin
  • I started the nuke build, got an error, and checked the config file in the .git directory.

I have done these steps multiple times, and they only happened twice.

RigijAselo avatar May 23 '25 18:05 RigijAselo

@RigijAselo, I am pushing a change that should resolve the issue. Please let me know if you are still able to reproduce the issue after installed the VS Code Insides that will be released on Monday.

lszomoru avatar May 24 '25 11:05 lszomoru

@lszomoru are there any steps for this?

connor4312 avatar Jun 05 '25 22:06 connor4312

I am still seeing this issue. I cannot pin down how to recreate it though.

blueboxes avatar Jun 06 '25 07:06 blueboxes

@blueboxes, what version of VS Code are you using? When you repro the issue can you please share the contents of the git output window?

lszomoru avatar Jun 06 '25 09:06 lszomoru

I am using VS Code Insiders most of the time and a combination of command line GIT and VS code git tooling.

The issue only seems to affect NUKE, using git comands seems not to be blocked by the issue.

Image

Image

If I look at the config file, I see it seems to duplicate many branch entries not just one.

Image

If I manually edit the config file in the .git folder it resolves the issue.

Its hard to spot when it first happens, just notice it next time I do a NUKE build

blueboxes avatar Jun 06 '25 10:06 blueboxes

@lszomoru I have managed to recreate the issue !!!!

If I clone a repo and do not change the branch or interact with GIT in anyway.

Next ask Github Co-Pilot (I was in Agent mode with Claude) to make a file edit it updates the config file in the .git folder adding duplicate vscode-merge-base This happens before I click accept edits but even after accepting edits it does not fix it.

This is not an issue for using VS code; however, NUKE builds error when it gets into this state.

Image

blueboxes avatar Jun 12 '25 13:06 blueboxes

@blueboxes, took another look at the code and I was able to reproduce the issue locally. I have pushed a fix for the issue which should hopefully address the issue and will be available in VS Code Insiders starting next week. Having said that, please note that running git config add with the same key will result in duplicate keys so duplicate keys is something that git allows in the config file. Ideally, NUKE should also handle duplicate keys more gracefully.

lszomoru avatar Jun 13 '25 11:06 lszomoru

@blueboxes, I was wondering if you could verify this issue. Thanks!

lszomoru avatar Jul 02 '25 08:07 lszomoru

All looks good now thank you

blueboxes avatar Jul 02 '25 11:07 blueboxes

Also looks good to me!

alexr00 avatar Jul 02 '25 15:07 alexr00