I didn’t get a chance to look too deep into it, while it looks great for human reading in a terminal, can I just as easily output the diff to a patch file like I do often with ‘git diff [commit][commit] > patch.txt and git apply it?
Patching. Difftastic output is intended for human consumption, and it does not generate patches that you can apply later. Use diff if you need a patch.
Since the diffs are tree-sitter based, it’s interesting to think about what a tree-sitter based patch would look like. Probably wouldn’t double as a human and computer friendly format like normals diffs. I suppose that you could create patches that are more robust to the source code changing since it wouldn’t care about linebreaks and maybe you could have it so it doesn’t care if you move code around since you could have it so its going by e.g. what the parent function is and not the line number. I gotta wonder how useful that actually is though.
I didn’t get a chance to look too deep into it, while it looks great for human reading in a terminal, can I just as easily output the diff to a patch file like I do often with
‘git diff [commit] [commit] > patch.txt
andgit apply
it?Doesn’t look like it, from their docs:
Since the diffs are tree-sitter based, it’s interesting to think about what a tree-sitter based patch would look like. Probably wouldn’t double as a human and computer friendly format like normals diffs. I suppose that you could create patches that are more robust to the source code changing since it wouldn’t care about linebreaks and maybe you could have it so it doesn’t care if you move code around since you could have it so its going by e.g. what the parent function is and not the line number. I gotta wonder how useful that actually is though.
Use diff for that?