Nice work, banga!
Show HN: GitHub style split diffs in your terminal
21–30 of 53 posts
Re: Show HN: GitHub style split diffs in your terminal
#22Re: Show HN: GitHub style split diffs in your terminal
#23Re: Show HN: GitHub style split diffs in your terminal
#24The I like this over fancy CLI diff viewers for a handful of reasons:
- It re-uses my editor config (no need to fuss with that tools ad hoc config format)
- I can navigate the diff with my editor’s navigation tools (expand or hide context lines, open/close/reorganize tabs, etc.)
- My editor’s language-aware tooling kicks in. I can jump to def, reveal types, and find all references while reading the diffs.
I wrote more about some of the specific workflows I use in this post, if you’re curious to level up from a CLI-only diff workflow:
https://blog.jez.io/cli-code-review/
There’s a time and a place for CLI-only diff viewers, and kudos to the author for building a tool they enjoy! I’ve just found that they fit into a sort of uncanny valley of simplicity and power for my needs.
Re: Show HN: GitHub style split diffs in your terminal
#25> package.json Bye. Context: What JS dependencies do is unheard of: https://news.ycombinator.com/item?id=26889543
Re: Show HN: GitHub style split diffs in your terminal
#26> package.json Bye. Context: What JS dependencies do is unheard of: https://news.ycombinator.com/item?id=26889543
what should this be made with
More seriously, as much as I'm personally not a huge fan of JS (but this is TypeScript?) I don't see how such comments add to the conversation. This particular package even seems to be very considerate with its dependencies: there's only a half dozen, and relate to obvious things like terminal coloring/manipulation, syntax highlighting, and diff generation… Now, I've not explored the full tree to see if those drag in the world, of course.
Sometimes, I think the hate on dependency trees gives them a bad rap. Code reuse lets people build things easily & quickly without having to badly reinvent every wheel! Sometimes, I get notified of a JS dependency with a security vulnerability where if a user can control how many spaces are used for indentation in some library's pretty-printer they can RCE and I die a little inside.
I think there are easier ways to get a side-by-side diff, but this tool does do a remarkable job of reproducing GitHub's aesthetics.
Re: Show HN: GitHub style split diffs in your terminal
#27Earlier quoted context omitted.
Yeah I (un)fortunately learned about delta too late or I probably wouldn't have made this. The main difference is that delta's default styles and appearance did not appeal to me. I'm sure it can be customized, but I wanted something that looked great by default. I especially like that the syntax highlighting matches vscode's since that's the editor I use for work.
> syntax highlighting matches vscode An that's cool. I've always had a dream of having the same syntax highlighting set up everywhere: vscode, bat, vim, git diff... etc.
Re: Show HN: GitHub style split diffs in your terminal
#28Earlier quoted context omitted.
what should this be made with
Why Rust of course! /s More seriously, as much as I'm personally not a huge fan of JS (but this is TypeScript?) I don't see how such comments add to the conversation. This particular package even seems to be very considerate with its dependencies: there's only a half dozen, and relate to obvious things like terminal coloring/manipulation, syntax highlighting, and diff generation… Now, I've not explored the full tree…
EDIT: Anyway, didn't mean to shit on author's work. (S)he apparently put fair amount of work into it, and the result looks great.
Re: Show HN: GitHub style split diffs in your terminal
#29Earlier quoted context omitted.
Why Rust of course! /s More seriously, as much as I'm personally not a huge fan of JS (but this is TypeScript?) I don't see how such comments add to the conversation. This particular package even seems to be very considerate with its dependencies: there's only a half dozen, and relate to obvious things like terminal coloring/manipulation, syntax highlighting, and diff generation… Now, I've not explored the full tree…
It's not about language nor dependency tree per se. It's about what is in that dependency tree. When I depend on a library A in say Python I can be reasonably sure that it won't download and execute random shit from Internet, nor that it will pull tons of other crap to log to console in colorful ANSI boxes. Basically, it's about NPM ecosystem, which is anything but trustworthy to be run as a terminal application. EDI…
If there are dependencies, there could be security risks.
JavaScript and NPM just have higher market share, so that's where attackers are more likely to focus their efforts. This is akin to all the people who used to say Macs aren't or can't be infected with malware.
What you could do is just audit the package list and try to make a reasonable decision. 35 different packages for a small script, some with almost no GitHub stars or downloads? Maybe cause for concern. A few well-known libraries? Probably less concerning. You'd need to audit the entire lock file to really be sure, but this gives you some idea, at least.
It's true that JS developers generally seem to tend towards using a larger number of smaller libraries on average, so it's possible the risk is a bit higher both due to that and the market share, and maybe a few other reasons, but it's not like there are any fundamental differences here.
Each project will have their own way of handling dependencies, regardless of the language. You have to evaluate individual projects in any language on a case-by-case basis, and not just stereotype based on the language used. If your comment instead was ripping on the actual contents of package.json (or requirements.txt etc.), then you'd quite possibly have a valid point, but balking at the mere existence of the file is pretty ridiculous.
Re: Show HN: GitHub style split diffs in your terminal
#30in your .gitconfig
[diff]
tool = icdiff
[difftool]
prompt = false
[difftool "icdiff"]
cmd = /usr/bin/icdiff --line-numbers $LOCAL $REMOTE | less -eFXR
then git difftool