github / github/copilot-cli

Copilot requires "directory access" when searching Git commit history via `git log -L /<regex>/,/<regex>/`

Aberta
#2,251 1 comentário 1 reação 0 responsáveis Ver no GitHub
area:permissions
Linguagem predominante
Shell
Estrelas
11.2k
Forks
1.9k
Merge médio
14h 16min
PRs com merge (30d)
6

Descrição

### Describe the bug

Copilot (or more likely, Claude Opus) is still quite clumsy when it comes to investigating Git commit history effectively. So I frequently tell it not to pipe `git log` output into `head` or `tail` or `grep` but instead to use the available options, such as `--grep `, `-G` or `-L //,//`. The latter, however, is mistaken by Copilot as a directory access, leading to strange/funny questions like this:

```

● Trace lints section origin (shell)
└ cd /home/me/wip && git
--no-pager log -L '/\[lints/,/all.*deny/':Cargo.toml
--oneline --no-patch HEAD | head -5

╭─────────────────────────────────────────────────────────────╮
│ Allow directory access │
│ ─────────────────────────────────────────────────────────── │
│ This action may read or write the following path outside │
│ your allowed directory list. │
│ │
│ ╭─────────────────────────────────────────────────────────╮ │
│ │ /\[lints/,/all.*deny/ │ │
│ ╰─────────────────────────────────────────────────────────╯ │
│ │
│ Do you want to allow this? │
│ │
│ 1. Yes │
│ ❯ 2. Yes, and add these directories to the allowed list │
│ 3. No (Esc) │
│ │
│ ↑↓ to navigate · Enter to select · Esc to cancel │
╰─────────────────────────────────────────────────────────────╯
```

### Affected version

1.0.9

### Steps to reproduce the behavior

1. Ask Copilot to run a `git log -L` command with regular expressions
2. observe the bogus "Allow directory access" question

### Expected behavior

Copilot should not mistake the ` in `git log -L ` for a directory.

### Additional context

_No response_

Guia de contribuição

Abrir o guia de contribuição

Direção de pesquisa

Comece reproduzindo o comando `git log -L '/\[lints/,/all.*deny/':Cargo.toml` relatado na issue e rastreie a detecção de acesso a diretórios da CLI. A alteração estará concluída quando os argumentos de expressão regular para `git log -L` não acionarem mais um prompt incorreto de permissão do diretório, enquanto os caminhos reais continuarem acionando-o.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
git, shell
Domínio
cli, security
Tipo de issue
Bug
Dificuldade
3/5
Tempo estimado
1-2 dias
Status de atividade
Pouca atividade
Clareza
Razoavelmente clara
Facilidade para iniciantes
48/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.