Repository: vscode
Issue: Git - VS Code's git commit error pop-up shows wrong hook failure
Labels: bug,git


Type: <b>Bug</b>

Description:
It seems when performing a git commit from the VS Code UI and there is a commit failure (e.x., in a git-hook) the error pop-up only shows only the first line of the output which is not necessarily the error.

Steps to Reproduce:
Perform a git commit from the VS Code UI so that you get a warning followed by an error. I'd expect to see the error message in the pop-up but instead the unrelated warning message shows which can be misleading.

Steps to Reproduce (Specific):
1. `lint-stages` issuing a warning "No staged files match any configured task" (which passes gracefully)
2. then there is an error from `commitlint` about a bad commit message.

More Details:
![image](https://github.com/user-attachments/assets/ad257a07-9a2a-4892-bdc8-49a5ad074be2)
raw commit output:
```
filepath> git commit -m "foo: this will fail"
→ No staged files match any configured task.
⧗   input: foo: this will fail
✖   type must be one of [build, chore, ci, docs, feat, fix, perf, refactor, revert, style, test] [type-enum]

✖   found 1 problems, 0 warnings
ⓘ   Get help: https://github.com/conventional-changelog/commitlint/#what-is-commitlint

husky - commit-msg hook exited with code 1 (error)
```
I'd like for the popup to read the actual error: "input: foo: this will fail, type must be one of [build, chore, ci, docs, feat, fix, perf, refactor, revert, style, test] [type-enum]".
Instead it shows the first line of output: "No staged files match any configured task." which is misleading since that's not the error.

This poster is having the same issue.
[stackoverflow: vs-codes-git-extension-shows-wrong-pre-commit-hook-failure](https://stackoverflow.com/questions/77507886/vs-codes-git-extension-shows-wrong-pre-commit-hook-failure)

VS Code version: Code 1.96.2 (fabdb6a30b49f79a7aba0f2ad9df9b399473380f, 2024-12-19T10:22:47.216Z)
OS version: Windows_NT x64 10.0.22631
Modes:

<details>
<summary>System Info</summary>

|Item|Value|
|---|---|
|CPUs|13th Gen Intel(R) Core(TM) i7-1355U (12 x 2611)|
|GPU Status|2d_canvas: enabled<br>canvas_oop_rasterization: enabled_on<br>direct_rendering_display_compositor: disabled_off_ok<br>gpu_compositing: enabled<br>multiple_raster_threads: enabled_on<br>opengl: enabled_on<br>rasterization: enabled<br>raw_draw: disabled_off_ok<br>skia_graphite: disabled_off<br>video_decode: enabled<br>video_encode: enabled<br>vulkan: disabled_off<br>webgl: enabled<br>webgl2: enabled<br>webgpu: enabled<br>webnn: disabled_off|
|Load (avg)|undefined|
|Memory (System)|15.72GB (1.67GB free)|
|Process Argv|--crash-reporter-id 4ec418d0-d2a2-4af6-a76f-82a40b32c2a6|
|Screen Reader|no|
|VM|0%|
</details><details><summary>Extensions (21)</summary>

Extension|Author (truncated)|Version
---|---|---
vscode-sqlite|ale|0.14.1
vscode-github-actions|git|0.27.0
vscode-pull-request-github|Git|0.102.0
rainbow-csv|mec|3.14.0
git-graph|mhu|1.30.0
vscode-docker|ms-|1.29.3
debugpy|ms-|2024.14.0
python|ms-|2024.22.2
vscode-pylance|ms-|2024.12.1
jupyter|ms-|2024.11.0
jupyter-keymap|ms-|1.1.2
jupyter-renderers|ms-|1.0.21
vscode-jupyter-cell-tags|ms-|0.1.9
vscode-jupyter-slideshow|ms-|0.1.6
remote-containers|ms-|0.394.0
remote-wsl|ms-|0.88.5
cpptools|ms-|1.22.11
vsc-octave-debugger|pau|0.5.13
code-spell-checker|str|4.0.34
octave|toa|0.0.3
pdf|tom|1.2.2


</details><details>
<summary>A/B Experiments</summary>

```
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805:30301674
binariesv615:30325510
vsaa593cf:30376535
py29gd2263:31024239
vscaac:30438847
c4g48928:30535728
azure-dev_surveyone:30548225
962ge761:30959799
pythonnoceb:30805159
pythonmypyd1:30879173
h48ei257:31000450
pythontbext0:30879054
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
dsvsc021:30996838
dvdeprecation:31068756
dwnewjupyter:31046869
nativerepl1:31139838
pythonrstrctxt:31112756
nativeloc2:31192216
cf971741:31144450
iacca1:31171482
notype1cf:31157160
5fd0e150:31155592
dwcopilot:31170013
stablechunks:31184530
6074i472:31201624

```

</details>

<!-- generated by issue reporter -->