microsoft / vscode

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

git.followTagsWhenSync is ignored #197468

Closed vanowm closed 10 months ago

vanowm commented 11 months ago

Type: Bug

With git.followTagsWhenSync setting enabled and a tag created with git tag blah after a commit, clicking "Sync Changes" button in Source Control Sync only pushes commit and not the new tag. Have to manually use git push --tags

VS Code version: Code 1.84.0 (d037ac076cee195194f93ce6fe2bdfe2969cc82d, 2023-11-01T11:29:04.398Z) OS version: Windows_NT x64 10.0.19045 Modes:

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz (16 x 3600)| |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
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|undefined| |Memory (System)|63.67GB (29.35GB free)| |Process Argv|--verbose| |Screen Reader|no| |VM|50%|
Extensions (85) Extension|Author (truncated)|Version ---|---|--- better-comments|aar|3.0.2 vscode-javascript-repl|ach|0.7.4 vscode-userscript|adp|1.3.2 Bookmarks|ale|13.4.2 tsl-problem-matcher|amo|0.6.2 vscode-scriptmonkey|and|0.0.8 chronicler|arc|0.1.16 autolispext|Aut|1.6.2 vscode-log-viewer|ber|0.14.1 github-markdown-preview|bie|0.3.0 markdown-checkbox|bie|0.4.0 markdown-emoji|bie|0.3.0 markdown-footnotes|bie|0.1.1 markdown-mermaid|bie|1.20.0 markdown-preview-github-styles|bie|2.0.3 markdown-yaml-preamble|bie|0.1.0 vscode-intelephense-client|bme|1.9.5 git-exclude|bou|0.3.1 phpserver|bra|3.0.2 insert-unicode|bru|0.15.1 turbo-console-log|Cha|2.9.6 jsdoc-generator|cry|2.0.1 autoit|Dam|1.0.12 vscode-eslint|dba|2.4.2 xml|Dot|2.5.1 gitlens|eam|14.4.1 EditorConfig|Edi|0.16.4 vscode-great-icons|emm|2.1.102 prettier-vscode|esb|10.1.0 vscode-macros|EXC|1.4.1 vscode-highlight|fab|1.9.0 vscode-firefox-debug|fir|2.9.10 auto-rename-tag|for|0.1.10 copilot|Git|1.133.531 copilot-chat|Git|0.10.0 copilot-labs|Git|0.15.1019 remotehub|Git|0.62.0 vscode-pull-request-github|Git|0.76.0 triggertaskonsave|Gru|0.2.17 reg|ion|1.1.0 vscode-peacock|joh|4.2.2 minifyall|jos|2.10.0 node-module-intellisense|lei|1.5.0 Lisp|mat|0.1.12 render-crlf|med|1.7.1 vscode-language-babel|mgm|0.0.40 git-graph|mhu|1.30.0 document|min|2.2.1 vscode-filesize|mkx|3.1.0 vscode-apache|mrm|1.2.0 vscode-edge-devtools|ms-|2.1.3 isort|ms-|2023.10.1 python|ms-|2023.20.0 vscode-pylance|ms-|2023.11.10 hexeditor|ms-|1.9.12 js-debug-nightly|ms-|2023.11.317 live-server|ms-|0.4.11 remote-repositories|ms-|0.40.0 test-adapter-converter|ms-|0.1.8 color-highlight|nau|2.5.0 vscode-auto-scroll|pej|1.1.0 vscode-versionlens|pfl|1.9.1 vscode-phpunit|rec|3.2.0 vscode-xml|red|0.26.1 format-html-in-php|rif|1.7.0 vs-code-prettier-eslint|rve|5.1.0 multi-command|ryu|1.6.0 vbsvscode|Ser|1.2.1 swapdiff|sha|0.2.2 comment-divider|sta|0.4.0 code-spell-checker|str|3.0.1 vscode-stylelint|sty|1.3.0 tabnine-vscode|Tab|3.24.1 tauri-vscode|tau|0.2.6 pdf|tom|1.2.2 vscode-ltex|val|13.1.0 intellicode-api-usage-examples|Vis|0.2.8 vscodeintellicode|Vis|1.2.30 vscode-wakatime|Wak|24.4.0 vscode-backup|Wes|0.0.6 eno|Wsc|2.3.53 php-debug|xde|1.33.1 local-history|xyz|1.8.1 json-color-token|yec|1.3.3 html-css-class-completion|Zig|1.20.0
ksmutny commented 10 months ago

I confirm it is ignored. I actually never got it working.

VS Code version: 1.84.2 git version: 2.42.0.windows.2 Windows version: Windows 11 Pro 23H2 22631.2506

lszomoru commented 10 months ago

If you open the git output window, and you run Sync Changes, do you see the --follow-tags option added to git push?

vanowm commented 10 months ago

@lszomoru yes,

2023-11-28 05:33:38.979 [info] > git push --follow-tags origin master:master [1859ms]

So, it's must be something on my end. After little research I found this answer:

--follow-tags Push all the refs that would be pushed without this option, and also push annotated tags in refs/tags that are missing from the remote but are pointing at committish that are reachable from the refs being pushed.

However

git tag v1.0.0 created a lightweight, non-annotated tag

So my tags are lightweight, therefore git ignores them.

For now, as a quick work around I'm using this pre-push hook:

#!/bin/sh
$(git push --tags --no-verify);
lszomoru commented 10 months ago

You can use the Git: Push Tags command to push all tags to the remote.