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

Integrate libgit2 for better table and string diff computations #32

Open
2 tasks
Duckwhale opened this issue Jan 20, 2023 · 2 comments
Open
2 tasks

Integrate libgit2 for better table and string diff computations #32

Duckwhale opened this issue Jan 20, 2023 · 2 comments

Comments

@Duckwhale
Copy link
Member

Duckwhale commented Jan 20, 2023

The current approach is hacky to say the least. For debugging failed assertions, a better diff output would be helpful.

Goals:

  • Can use libgit2 APIs to compute "real" diffs in memory
  • Failed assertions display (a part of) the diff string for tables and strings

Possibly relevant:


Obviously, adding another dependency is hardly ideal. But I haven't found a simpler solution that "just works".

Additionally, relying on libgit2 instead of shelled-out git commands for the BuildTools module would make the changelog generation logic more portable, so that it could be used to implement a standalone changelog generator (for which I'd have other uses). Lastly, if a install (download/clone) command was to be implemented, it could also use this library.

@Duckwhale
Copy link
Member Author

Example for some better output format (TBD):

https://github.com/avajs/ava#magic-assert

@Duckwhale
Copy link
Member Author

While git would also enable cloning packages for #320 , neovim uses xdiff and that might be another option?

See https://github.com/neovim/neovim/blob/05fd70f19b39519985000141d022971e37d66189/src/nvim/lua/xdiff.c#L26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Soon™
Development

No branches or pull requests

1 participant