Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Review context trims the first column of git status --short

Aperta Adatta ai principianti
#813 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 7 giorni

@azixxxxx ci sta già lavorando.

Dal 14/10/2026.

  • #817 di @azixxxxx — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
86/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
git, javascript
Ambito
tooling

Direzione di ricerca

Leggi in plugins/codex/scripts/lib/git.mjs la parte attorno a collectWorkingTreeContext e formatSection, poi cerca i test per il contesto di revisione inline e lightweight. Riproduci lo stato misto delle modifiche in staging e non in staging descritto nell’issue e verifica che M a.js rimanga nella sezione Git Status. Conferma inoltre che una sezione vuota continui a mostrare (none).

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

Descrizione

Problem

collectWorkingTreeContext in plugins/codex/scripts/lib/git.mjs trims the git status --short output:

const status = gitChecked(cwd, ["status", "--short", "--untracked-files=all"]).stdout.trim();

formatSection then trims it again:

return [`## ${title}`, "", body.trim() ? body.trim() : "(none)", ""].join("\n");

In the short format, the first column is the staged state and the second column is the unstaged state. When the first line is an unstaged change, the trim removes its leading space, and the line now says the change is staged.

Example

Commit a.js and b.js, change both, and stage only b.js:

git status --short:  " M a.js\nM  b.js\n"
review context:      "M a.js\nM  b.js"

Codex reads a.js as staged, not unstaged. This happens in the inline and the lightweight context.

Suggested fix

Keep the leading white space and remove only the trailing new lines:

const status = gitChecked(cwd, ["status", "--short", "--untracked-files=all"]).stdout.trimEnd();
return [`## ${title}`, "", body.trim() ? body.trimEnd() : "(none)", ""].join("\n");

A test with an unstaged change in the first status line that checks for M a.js in the Git Status section, and a test that an empty section still shows (none), would cover it.

Found at db52e28f4d9ded852ab3942cea316258ae4ef346 (v1.0.6). The lines are the same on main.

Lingua principale
JavaScript
Stelle
34.4k
Fork
2.4k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

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.

Altre issue di openai/codex-plugin-cc

Tutte le issue di openai/codex-plugin-cc

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.