mhutchie / vscode-git-graph

View a Git Graph of your repository in Visual Studio Code, and easily perform Git actions from the graph.
https://marketplace.visualstudio.com/items?itemName=mhutchie.git-graph
Other
1.97k stars 261 forks source link

File View shows empty on Windows 10 #720

Open beback4u opened 1 year ago

beback4u commented 1 year ago

Describe the Bug Git Graph shows empty in the File View on Windows 10 if I click one of commits.

Steps to Reproduce Steps to reproduce the behaviour:

  1. Set up your local repo for Chromium with VSCode on Windows.
  2. Click "Git Graph" icon on the status bar in VSCode IDE.
  3. It will show all commits and branches correctly.
  4. Click one of commits
  5. The File View will be empty.

Expected Behaviour The change list of files and directories should be shown in the File View.

Environment

Screenshots (optional) image

Additional Context (optional)

⚠ Please make sure you complete all of the required sections of this template. Without this required information, it will be harder to replicate this bug, and cause additional delays in resolving it.

beback4u commented 1 year ago

Chromium uses \depot_tools\git.bat by default. Looks like the issue (git diff doesn't return anything in getCommitDetails) was caused by an escape character (caret: ^) for Windows batch script.

git diff --name-status --find-renames --diff-filter=AMDR -z abcdef^ abcdef # this doesn't work with git.bat
git diff --name-status --find-renames --diff-filter=AMDR -z abcdef~1 abcdef # this seems to work but still has some other issues

As a workaround, it'll work if expanding git.path to the actual exe path as below:

    //"git.path": "C:\\src\\depot_tools\\git.bat",
    "git.path": "C:\\src\\depot_tools\\bootstrap-2@3_8_10_chromium_23_bin\\git\\bin\\git.exe",