Hacker News new | ask | show | jobs
by thfuran 15 days ago
Git is the one treating code like a text file instead of code.
2 comments

Git store whole files. The diff and the merge algorithm works by line by default, but that's because line is a rough unit of code (statement, expression, and definition happens mostly within one line).
I pull out difftastic when it’s all too hard for this. Diffs based off tree sitter
Don't forget mergiraf, for tree-sitter-based conflict resolution:

https://mergiraf.org/

I absolutely love the images on the landing page. "Inappropriate use of blame, push and pull to resolve a conflict" is pure genius. Even the name had a lot of thought put into it (didn't know about "Giraffe language" before). Beautiful! :)
The documentation is truly a thing of beauty.

As someone who learned a lot from Non-Violent Communication, discovering mergiraf went something like

  > ...oh, cool - I've wanted this for years, great that someone buckled down and wrote it.
  >
  > Why 'mergiraf,' though? 
  >
  > [Sees NVC link on the site] 
  >
  > ...OH. Conflict resolution through understanding. That's absolutely brilliant, at so many levels.