Skip to content

Require confirmation for git show --output in terminal auto-approval - #329026

Merged
Anthony Kim (anthonykim1) merged 1 commit into
mainfrom
anthonykim1/confirm-git-show-output
Aug 4, 2026
Merged

Anthony Kim (anthonykim1) merged 1 commit into
mainfrom
anthonykim1/confirm-git-show-output

Conversation

@anthonykim1

@anthonykim1 Anthony Kim (anthonykim1) commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Resolves: #329029

  • Share the default Git terminal auto-approval rules between workbench and Agent Host.
  • Require confirmation when git show uses --output=<path> or --output <path>.
  • Keep ordinary git show, --format, and similarly named options auto-approved.
  • Preserve support for git -C <path> and git --no-pager prefixes.
  • Keep all other existing Git auto-approval behavior unchanged.
  • Add focused workbench and Agent Host regression coverage.

Inspirations from:

Share the existing Git auto-approval rules across workbench and Agent Host,
and deny automatic approval when git show writes through --output.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: bda42f98-e73f-417f-b7e6-03cff9e2f604

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Shares Git terminal auto-approval rules across the workbench and Agent Host, while adding confirmation for git show --output.

Changes:

  • Extracts shared Git auto-approval rules.
  • Adds git show --output denial rules.
  • Adds workbench and Agent Host regression coverage.
Show a summary per file
File Description
src/vs/platform/terminal/common/autoApprove/gitAutoApproveRules.ts Defines shared Git rules and the new denial.
src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalChatAgentToolsConfiguration.ts Uses the shared rules in workbench defaults.
src/vs/platform/agentHost/node/commandAutoApprover.ts Uses the shared rules in Agent Host fallback defaults.
src/vs/workbench/contrib/terminalContrib/chatAgentTools/test/electron-browser/runInTerminalTool.test.ts Adds workbench regression cases.
src/vs/platform/agentHost/test/node/commandAutoApprover.test.ts Adds Agent Host regression cases.

Review details

  • Files reviewed: 5/5 changed files
  • Comments generated: 1
  • Review effort level: Balanced

@anthonykim1
Anthony Kim (anthonykim1) marked this pull request as ready for review August 4, 2026 19:34
@anthonykim1
Anthony Kim (anthonykim1) enabled auto-merge (squash) August 4, 2026 19:39
@anthonykim1
Anthony Kim (anthonykim1) merged commit 0e09b39 into main Aug 4, 2026
30 checks passed
@anthonykim1
Anthony Kim (anthonykim1) deleted the anthonykim1/confirm-git-show-output branch August 4, 2026 20:04
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Sep 18, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

Terminal auto-approval allows git show file output without confirmation

3 participants