Huge shoutout to pierrecomputer. Inspired by diffshub, this tool is only possible thanks to the incredibly beautiful and high-performance diff and tree packages. All credit goes to the team!
A browser diff viewer for local git/jj diffs and GitHub PRs. It uses pierrecomputer's open-source packages:
@pierre/diffsfor parsing/rendering diffs@pierre/treesfor the file tree
Run directly with npx:
npx @baggiiiie/yadiff
npx @baggiiiie/yadiff <git-ref-or-range>/<jj-revset>/<github-pr-url>
npx @baggiiiie/yadiff --working/--staged/--dirtyOr install globally:
npm install -g @baggiiiie/yadiff
yadiff HEADThe command starts a local server in the background, opens the browser, acquires a diff from the selected source, and serves the patch to the browser. With no target, it defaults to --working (jj @ in a jj workspace, otherwise git diff). The shell command exits after launch. When there are no browser sessions for one minute, the local server exits automatically.
Use --foreground to keep the server attached to the current terminal.
Git:
npx @baggiiiie/yadiff
npx @baggiiiie/yadiff HEAD
npx @baggiiiie/yadiff main..feature
npx @baggiiiie/yadiff main...HEAD --repo ../some-repo
npx @baggiiiie/yadiff --working/--staged/--dirtyjj:
npx @baggiiiie/yadiff @ --repo ../some-jj-repo
npx @baggiiiie/yadiff 'mine() & mutable()' --vcs jjGitHub:
npx @baggiiiie/yadiff https://github.com/oven-sh/bun/pull/30412Passing bun test:
yadiff.mp4
- add a button to sync review to github, with
ghcli? - copy filename
- support for private repo and enterprise, with
ghcli - stdin support
MIT.
