Skip to content

Support non-git diffs from stdin or two files - #173

Open
alchemmist wants to merge 2 commits into
jnsahaj:mainfrom
alchemmist:140
Open

Support non-git diffs from stdin or two files#173
alchemmist wants to merge 2 commits into
jnsahaj:mainfrom
alchemmist:140

Conversation

@alchemmist

Copy link
Copy Markdown

Closes #140.

Makes lumen diff render diffs without a repository:

arc diff | lumen diff --stdin      # or: lumen diff -
lumen diff --files old.txt new.txt

The unified diff is parsed into the existing FileDiff pipeline, so highlighting, sidebar, search and annotations work as usual.

Notes:

  • --stdin shows the hunks and their context (a patch), not the whole file.
  • Three-way (diff3) mode is not included.
  • When a diff is piped in, stdin is reconnected to the terminal so the viewer can still read input (via stdout/stderr, since macOS /dev/tty cannot be registered by crossterm's kqueue reader).

@alchemmist

Copy link
Copy Markdown
Author

@jnsahaj hello! Can you check it please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FR] Support non-git diffs (two-file and three-file modes)

1 participant