Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

fix(cli): keep the commit-session trailer dedup working on git 2.39

Fechada Para iniciantes
#940 1 comentário 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
2/5
Tempo estimado
1-3 horas
Facilidade para iniciantes
84/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
git, typescript
Domínio
cli, testing-qa

Direção de pesquisa

Execute cd cli [?25l&& npx vitest run tests/contexts/telemetry/domain/formats/commit-session-trailer.integration.test.ts e inspecione o fixture e o delegate que escreve o trailer por volta da linha 72. Garanta que o fixture ou o delegate lide com a ausência de uma nova linha final, para que duas passagens deixem um trailer; em seguida, confirme que o teste de integração passa no git 2.39.2.

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

Descrição

Observed

cli/tests/contexts/telemetry/domain/formats/commit-session-trailer.integration.test.ts:72 ("never doubles a trailer a prior run already wrote") runs the trailer-writing delegate twice and asserts the trailer token appears once.

On git 2.39.2 the test fails with AssertionError: expected 2 to be 1: the fixture message has no trailing newline, so git appends the trailer without a blank-line separator; the second pass then sees no trailer block and --if-exists doNothing appends again. The same delegate on a message ending in a newline dedupes correctly.

Reproduction

  1. git --version -> 2.39.2 (or any version sharing this behavior).
  2. cd cli && npx vitest run tests/contexts/telemetry/domain/formats/commit-session-trailer.integration.test.ts -> fails alone, deterministic, also under env -i.
  3. The same test passes on newer git (CI's).

Impact

The suite reports one failure per run on machines with this git, masking real regressions in the file and eroding trust in the suite's signal. The test and its source are byte-identical to next, so the failure predates any recent change.

Suggested fix

End the fixture message with a newline, or have the delegate normalize the message before appending.

Standalone repro verified on the machine that reported it: message without trailing newline doubles the trailer; message with one dedupes.

Linguagem predominante
TypeScript
Estrelas
481
Forks
45
Merge médio
1d 3h
PRs com merge (30d)
100

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de ai-driven-dev/framework

Todas as issues de ai-driven-dev/framework

Issues semelhantes

Mais issues de TypeScript

Receba novas issues na sua caixa de entrada

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