Live data from Hacker News

Better Git diff output for Ruby, Python, Elixir, Go

tekin.co.uk

51–53 of 53 posts

Re: Better Git diff output for Ruby, Python, Elixir, Go

#51

A bigger problem is tree structures, it is particularly egregious for HTML and JSON where the output tend to be a complete mess of red and green. I think a good solution would be for git to call out to the respective language servers (the VS Language Server Protocol) and render changes based on AST and syntax specific diffs.

If you keep each entity on a new line in both HTML and JSON it's actually quite correct.

Re: Better Git diff output for Ruby, Python, Elixir, Go

#53
post #43

Earlier quoted context omitted.

I rarely see files with incorrect file extensions outside of collisions and user error? I don’t see any downside apart from extensionless files like shell scripts with the executable flag set, shebang, and no file extension which could also be solved. Edit: and if comprehensive correctness was truly desired, file magic could make a better guess, but that would be overkill imo.

What's a '.m' file? Matlab, Objective-C, or Mathematica?

Whichever is most common. Alternatively, use file magic to determine type in cases of collision, or do nothing (75+% of devs wouldn’t use these).
Post reply on HN