microsoft / vscode

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

'git log' command returns nothing in terminal when using Python Extension #211272

Open Saltsmart opened 5 months ago

Saltsmart commented 5 months ago

Type: Bug

Behaviour

'git log' command returns nothing in integrated terminal (Command Prompt and Powershell are just the same) when using Python Extension.

Steps to reproduce:

  1. Open a git repository in VSCode (Note it has commit history, and 'git log' should show something)
  2. Open an intergrated terminal
  3. Execute 'git log' command

Diagnostic data

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

``` # **Nothing here for this issue** ```

Extension version: 2024.4.1 VS Code version: Code 1.88.1 (e170252f762678dec6ca2cc69aba1570769a5d39, 2024-04-10T17:41:02.734Z) OS version: Windows_NT x64 10.0.22000 Modes:

User Settings

``` languageServer: "Pylance" ```

Installed Extensions |Extension Name|Extension Id|Version| |---|---|---| |Black Formatter|ms-python.black-formatter|2024.2.0| |Flake8|ms-python.flake8|2023.10.0| |JavaScript Debugger|ms-vscode.js-debug|1.88.0| |JavaScript Debugger Companion Extension|ms-vscode.js-debug-companion|1.1.2| |Jupyter|ms-toolsai.jupyter|2024.3.1| |Jupyter Notebook Renderers|ms-toolsai.jupyter-renderers|1.0.17| |Pylance|ms-python.vscode-pylance|2024.4.1| |Python|ms-python.python|2024.4.1| |Python Debugger|ms-python.debugpy|2024.4.0| |Table Visualizer for JavaScript Profiles|ms-vscode.vscode-js-profile-table|1.0.8| |Tensorboard|ms-toolsai.tensorboard|2023.10.1002992421|
System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz (12 x 2208)| |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
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|undefined| |Memory (System)|15.85GB (8.66GB free)| |Process Argv|--crash-reporter-id deaad0bf-2897-480e-b8cf-04d2a61dc2e3| |Screen Reader|no| |VM|0%|
A/B Experiments ``` vsliv368:30146709 vspor879:30202332 vspor708:30202333 vspor363:30204092 vscoreces:30445986 vscod805cf:30301675 binariesv615:30325510 vsaa593:30376534 py29gd2263:31024239 c4g48928:30535728 azure-dev_surveyone:30548225 962ge761:30959799 pythongtdpath:30769146 welcomedialog:30910333 pythonidxpt:30866567 pythonnoceb:30805159 asynctok:30898717 pythontestfixt:30902429 pythonregdiag2:30936856 pyreplss1:30897532 pythonmypyd1:30879173 pythoncet0:30885854 h48ei257:31000450 pythontbext0:30879054 accentitlementst:30995554 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 cppperfnew:31000557 d34g3935:30971562 fegfb526:30981948 bg6jg535:30979843 ccp2r6:30993542 dsvsc020:30976470 pythonait:31006305 gee8j676:31009558 chatpanelt:31018789 dsvsc021:30996838 0ee40948:31013168 pythoncenvpt:31022790 ```
alexr00 commented 5 months ago

@Saltsmart can you share a screenshot of the whole window when you try to do this?

Saltsmart commented 5 months ago

@Saltsmart can you share a screenshot of the whole window when you try to do this?

Here I have a workspace with two folders: batterynet and torchode. No matter VSCode opens the workspace or the batterynet folder, git log has no output: image image

Only when I disable Python extension and relaunch terminal, can git log produces output: image

Here is the scene with Python extension disabled but without terminal relaunched: image

Then the terminal has been relaunched: image

Finally, re-enable Python extension and relaunch the terminal: image

It is just the same to use PowerShell. In the case below, the Flake8 extension or other extension depending on Python could lead Reactivating Terminals, but the issue still happens without these extension: image image image image

Saltsmart commented 5 months ago

This is mostly the matter with VSCode. It has nothing weird to execute git log command in Windows PowerShell: image

Saltsmart commented 5 months ago

Is there some command to clear the history (or cache) related to git in VSCode?

It's normal to use git log in other directories, even with all my Python-related extensions: image

I think it may be caused by the cache, so I followed the steps in this blog to clear the cache, but nothing changes.

I have tried to delete the .git subfolder, re-init the repository, and rename this workplace and this folder, but nothing changes.

Will VSCode restore some information for the git repositories?