gitui-org / gitui-org/gitui

Wrong diff highlighting for "no newline at end of file"

Aperta
#2,223 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug
Lingua principale
Rust
Stelle
22.5k
Fork
773
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

When a file without newline at the end is "fixed" by adding a newline, the diff view shows the message "\ No newline at end of file" in green:

![image](https://github.com/extrawurst/gitui/assets/2412819/9fe9427d-cc5a-4b4e-b23f-0797229c277c)

This is a bit misleading, it suggests that the change was to remove the newline rather than add it.

For comparison here's how it looks with the default `git diff`:

![image](https://github.com/extrawurst/gitui/assets/2412819/96fbb6c6-97a2-451c-8311-a80c119a835a)

(tested on gitui 0.26.1)

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Reproduce the reported diff view behavior for a file whose missing final newline is added, using the issue screenshots and gitui 0.26.1 as reference. Trace the diff highlighting behavior and verify that the no-newline message is colored consistently with the corresponding default git diff output.

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

Valutazione

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

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.