• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

umputun / revdiff / 26734477458

01 Jun 2026 04:02AM UTC coverage: 89.796% (-0.007%) from 89.803%
26734477458

push

github

web-flow
feat: parse multi-file git diffs piped to stdin (#216)

* feat: parse multi-file git diffs piped to stdin

* fix(stdin): harden multi-file diff detection and size-cap stdin

Address PR #216 review:
- fail NewMultiFileStdinReader on any per-section parse error so the
  caller falls back to raw-text mode for the whole input instead of
  silently dropping files behind an invisible stderr warning
- cap stdin reads at 64 MiB via io.LimitReader and convert the buffer
  to a string once instead of three times
- anchor the unified-diff sniffer to line-start (matching "diff --git
  a/" at column 0) and drop the loose "@@ -" substring fallback so
  markdown prose mentioning the marker is not reclassified
- expose ErrNotUnifiedDiff sentinel for silent fallback; log non-sentinel
  parse failures via log.Printf so they survive the alt-screen
- split MultiFileStdinReader into its own file, drop the redundant
  NewStdinReaderFromString constructor, unexport the sniffer
- docs updated: README, site/docs.html, usage reference, all three
  SKILL.md copies (with gh pr diff / git format-patch guidance),
  ARCHITECTURE renderer table

* fix(stdin): fail whole reader on empty-path or hunkless sections

splitMultiFileDiff now errors when parseFileHeader yields no path, and
NewMultiFileStdinReader rejects zero-line sections that carry no
structural marker (rename, mode, binary, hunk). Both used to silently
drop a section, hiding real stdin behind an empty tree entry.

Also: dedupe duplicate paths in MultiFileStdinReader.order, route
`rename to` through cleanPath, fix cleanPath double-stripping a
top-level dir named a/ or b/, rename stdin_test.go to multistdin_test.go,
correct selectStdinRenderer godoc rationale, revert paren-wrap on the
single-import in app/diff/stdin.go, and document the 4 KiB sniff-window
tradeoff for format-patch input.

167 of 191 new or added lines in 3 files covered. (87.43%)

9962 of 11094 relevant lines covered (89.8%)

3131.21 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

92.08
/app/diff/multiparse.go


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc