github / github/copilot-cli

DESTRUCTIVE (forced) git branch deletion is MISCLASSIFIED and requires NO PERMISSION

Aperta
#4,156 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

area:permissions area:tools
Lingua principale
Shell
Stelle
11.2k
Fork
1.9k
Merge medio
14h 16m
PR unite (30g)
6

Descrizione

Describe the bug

Per /diagnose:


Found it. The root cause is clear from the event log:

  • git push --delete at 20:42:24 → generated a permission.request event → you were prompted ✅
  • git branch -D at 20:43:03 → no permission.request event at all → ran silently ❌

The CLI classifies commands by identifier to determine if they're read-only. In the git push permission request, git push is correctly tagged "readOnly": false. But earlier in the session, git branch -r was tagged "readOnly": true — and the classifier appears to treat all git branch invocations as read-only, regardless of flags like -D.

In short: this is a classifier bug in the CLI. It doesn't recognize that git branch -D is destructive, so it skips the permission prompt entirely. git push --delete was correctly flagged; git branch -D was not.

This is worth reporting via /feedback — the git branch command classifier needs to recognize -D / -d / --delete as write operations.

Affected version

GitHub Copilot CLI 1.0.71.

Steps to reproduce the behavior
  • Ask Copilot to delete one or more remote branches to provoke it to call git push --delete ....
  • Observe that the command requires user acknowledgement.
  • Ask Copilot to delete one or more local branches to provoke it to call git branch -D ....
  • Observe that the command runs with no permission prompt.
Expected behavior

A destructive operation such as DELETING A BRANCH should require confirmation by default.

Additional context

No response

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia dal classificatore dei comandi CLI e analizza come gli identificatori di git branch vengono associati agli eventi readOnly e permission.request. Riproduci il comportamento con git branch -D, -d e --delete, quindi verifica che le varianti distruttive richiedano una conferma, mentre git branch -r rimanga di sola lettura.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
git
Ambito
cli, security
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
55/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.