Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use git diff for diffs #150

Open
wants to merge 33 commits into
base: master
Choose a base branch
from
Open

Use git diff for diffs #150

wants to merge 33 commits into from

Conversation

danvk
Copy link
Owner

@danvk danvk commented Sep 17, 2022

  • For file diffs: difflib.js → git diff --no-index left right
  • For directory diffs: hand-rolled code → git diff --no-index --raw left right

This eliminates a bunch of code, gets us much better diffs and lots more options. The one downside is that we have to invoke git difftool with --no-symlinks. This means that you can't make changes to unstaged files after running git webdiff and reload to see the changes. This is a fundamental issue with how git diff --no-index handles symlinks, see https://public-inbox.org/git/1489877673.24742.1.camel@kaarsemaker.net/t/

I also took the opportunity to update a few dependencies and plug in a system for options using .gitconfig.

Closes #129
Fixes #100
Closes #120
Fixes #7
Fixes #82
Fixes #121

@danvk danvk marked this pull request as ready for review September 24, 2022 16:27
@danvk
Copy link
Owner Author

danvk commented May 18, 2023

TODO: this chops off the last line of files w/o trailing newlines

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant