uutils / uutils/diffutils

sdiff: implement the `|` marker for changed lines

Offen
#272 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
Rust
Sterne
276
Forks
39
Ø Merge
3 Std. 27 Min.
Gemergte PRs (30 T.)
3

Beschreibung

src/side_diff.rs currently emits only <, > and blank gutters. Lines that exist in both files but differ are printed as a separate deletion and insertion instead of a single row with |.

The | is produced at print time, by pairing positionally inside a contiguous change hunk. For a run of N deletions and M insertions, the first min(N, M) are printed as pairs with |, and the leftovers keep < or >. The pairing is positional, so the two lines of a | row need nothing in common:

$ diff -y --width=40 L R      # L: a,b1,b2,b3,c   R: a,X,c
a			a
b1		   |	X
b2		   <
b3		   <
c			c

So the change is confined to the consumption of the current engine diff's. Buffer the run of Left/Right results, and on the next Both (or at EOF) flush it with the pairing above.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Start in src/side_diff.rs and trace how the current engine diff’s Left, Right, and Both results are consumed. Verify the change with the provided diff -y example, including a hunk with unequal deletion and insertion counts. Done means positional pairs in each contiguous change hunk print with |, while leftovers retain < or > and unchanged lines remain unaffected.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
rust
Bereich
cli
Issue-Typ
Feature
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Ruhig
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
76/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.