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

Replace libgit2 with gitoxide #3235

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

blinxen
Copy link

@blinxen blinxen commented Mar 21, 2025

As discussed in #3151, I have prepared a PR to replace the libgit2 usage in bat with gitoxide. The PR is not finished yet because some tests are failing since the produced git diff does not match the exact behavior of libgit2.

I see here two solutions:

  • Extend the imara-diff crate to generate git like diffs
  • Adapt the tests to accept the new diff format (it is not a format but more like a different diffing algorithm)

What do the maintainers think?

CC: @Byron

@keith-hall
Copy link
Collaborator

Thanks for working on this! Honestly, it feels like the diffs are still valid, so adapting the tests is acceptable in my opinion. However you might find that extending the imara-diff crate to generate git-like diffs will make more people happy in the long run, so I would say that it depends what you feel up to really 🙂

@Byron
Copy link

Byron commented Mar 22, 2025

You may also find this document about diff-sliders interesting. It also details the tuning that Git has received to produce more 'likable' diffs, some of which libgit2 seems to inherit. It seems like an art as well.

Right now, imara-diff has received no time in the direction of optimizing diffs for humans, and I think it would have to be a community effort if that should happen.

As this comes up all the time, I also feel that pressure is mounting, and more so the more people use imara-diff :).

@blinxen
Copy link
Author

blinxen commented Mar 23, 2025

I think that trying to improve imara-diff would be more interessting. I checked the git mailing list and found the initial patch that introduced what the diff-sliders document proposes. I will check it out and try to implement something similiar for imara-diff. At the mean time we can keep this PR open since it does not have any urgency.

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.

3 participants