git-merge-driver
diffsitter
Our great sponsors
git-merge-driver | diffsitter | |
---|---|---|
2 | 15 | |
96 | 1,524 | |
- | - | |
0.0 | 8.6 | |
3 months ago | about 19 hours ago | |
Shell | Rust | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
git-merge-driver
-
Is it possible to automate merges with folders that have known resolution paths when conflicts occur?
You could make a custom merge driver for the conflicting file: https://github.com/Praqma/git-merge-driver
-
What if Git worked with Programming Languages?
I investigated the option of using a custom git merge driver for a project where we were planning to version control a bunch of data files using git.
Here's a proof of concept python merge driver I bashed together at the time to auto-merge JSON objects: https://github.com/fcostin/jsonmerge_git_merge_driver
This never went anywhere near production, but it was very easy to put together something basic.
One complication with using a custom merge driver, as discussed by https://github.com/Praqma/git-merge-driver , is that they need to be configured inside the `.git/config` of the repo, which itself is not version controlled. So there's an additional config management overhead to rolling that out to everyone in a machine. Additionally, if outsourcing hosting for git repos, it may not be supported to install and configure a custom merge driver for merges conducted by the hosting platform (e.g. merges created by github.com pull request workflow).
One idea I had at the time was using external schema files (e.g. JSON schema for JSON files) to help guide/constrain the result of the merge. I never implemented it, but it should be possible. If the schemas were also version controlled in the same git repo that stores the data, you'd need to figure out which one (and which version) to load when resolving a merge conflict of a data file. There doesn't seem to be a well-supported robust way for a merge driver script to discover the source and destination branches, but there are some potentially fragile ways of doing it that work some of the time.
diffsitter
-
AST-grep(sg) is a CLI tool for code structural search, lint, and rewriting
Or https://github.com/afnanenayet/diffsitter. I've tried both and I like them. No preference or notable opinions on them yet!
-
Enable new diff option linematch (#14537) · neovim/neovim@04fbb1d
For git diff's I've been using https://github.com/afnanenayet/diffsitter
-
Difftastic, the Fantastic Diff: How it works
One more tree-sitter based diffing tool - diffsitter
https://github.com/afnanenayet/diffsitter
-
What Comes After Git
Several threads here point to difftastic: https://github.com/Wilfred/difftastic
I know a lot of people who have a lot of hope for diffsitter (or something like it): https://github.com/afnanenayet/diffsitter
Personally, I think the reason most "good" semantic diff tools are proprietary is that they are huge amounts of effort that are mostly "hacks" and "heuristics" bandaged together in ways that people don't want to let out how the sausage was made.
But I also "general, language agnostic AST-based semantic diff" is a mountain peak we cannot reach (probably ever), and I believe my experiments found an interesting local maxima that people are maybe sleeping on (lexer-based diffs rather than parser-based diffs): https://github.com/WorldMaker/tokdiff
-
Fast Kernel Headers: Tree -v1: Eliminate the Linux kernel's "Dependency Hell"
https://github.com/afnanenayet/diffsitter there are quiet a few projects such as this one, attempting to solve the issue. :)
-
Thinking about programming systems and not just languages and environments
There’s an interesting project in the semantic diff/merge space that I have been keeping an eye out for https://github.com/afnanenayet/diffsitter
-
What if Git worked with Programming Languages?
I have never used any of them, but it look like tree-sitter based diff tools are exactly what you are searching for (like difftastic, gumtree or diffsitter).
I believe Unison is the only attempt to do this at a programming language/environment level.
For Git diffs, there is Diffsitter, which uses Tree Sitter to generate semantic diffs of code files: https://github.com/afnanenayet/diffsitter
I have not used it, but it is high on my todo list.
-
Difftastic: A syntactic diff tool
Looks great, I'll try it! FYI, there is a very similar project called diffsitter https://github.com/afnanenayet/diffsitter
- diffsitter - a tree-sitter based AST difftool to get meaningful semantic diffs
What are some alternatives?
nvim-treesitter-context - Show code context
difftastic - a structural diff that understands syntax 🟥🟩
git-sqlite - A custom diff and merge driver for sqlite
semantic-source - Parsing, analyzing, and comparing source code across many languages
nbdime - Tools for diffing and merging of Jupyter notebooks.
unison - A friendly programming language from the future
tree-sitter-json - JSON grammar for tree-sitter
structured-haskell-mode - Structured editing minor mode for Haskell in Emacs
dark - Darklang main repo, including language, backend, and infra
terminusdb - TerminusDB is a distributed database with a collaboration model
locust - "git diff" over abstract syntax trees