Live data from Hacker News

Show HN: GitHub style split diffs in your terminal

github.com

31–40 of 53 posts

Re: Show HN: GitHub style split diffs in your terminal

#31
post #5

I already use delta for this: https://github.com/dandavison/delta I thought delta was fairly well-known by now so I was surprised to see this project not mention it (the readme already has a section for that). I wonder what they've chosen to do differently, besides write it in Node.js.

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.

I agree that's important! Delta's screenshot colors are so ugly that yours looks like the far superior product. It also seems more focused on diffs. I feel like I could drop in your project instantly, while delta seems to expect configuration.

Re: Show HN: GitHub style split diffs in your terminal

#32
Is anyone familiar with a good way to programatically create a diff like this as an image?

I wrote a small script that tracks changes to your kubernetes cluster and sends a diff of the yaml to Slack. It works but I want to prettify the diff with a GitHub style diff and I need it in image format to send to slack.

Re: Show HN: GitHub style split diffs in your terminal

#34
post #32

Is anyone familiar with a good way to programatically create a diff like this as an image? I wrote a small script that tracks changes to your kubernetes cluster and sends a diff of the yaml to Slack. It works but I want to prettify the diff with a GitHub style diff and I need it in image format to send to slack.

I actually tried to automate the screenshots for this project's readme using GitHub actions, but struggled to get it to produce the same quality screenshots as my local machine. This is the script I use for now, which has to be invoked manually: https://github.com/banga/git-split-diffs/blob/main/scripts/g...

Re: Show HN: GitHub style split diffs in your terminal

#35
post #32

Is anyone familiar with a good way to programatically create a diff like this as an image? I wrote a small script that tracks changes to your kubernetes cluster and sends a diff of the yaml to Slack. It works but I want to prettify the diff with a GitHub style diff and I need it in image format to send to slack.

I actually tried to automate the screenshots for this project's readme using GitHub actions, but struggled to get it to produce the same quality screenshots as my local machine. This is the script I use for now, which has to be invoked manually: https://github.com/banga/git-split-diffs/blob/main/scripts/g...

Thank you. If you find a better way which works on a headless Linux container let me know. I would be interested in the older versions of your automation even if the output is worse quality so long as the quality is acceptable.

Re: Show HN: GitHub style split diffs in your terminal

#36

Earlier quoted context omitted.

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…

This is illusory safety. The exact same risks are present in PyPI. There've been plenty of notorious malicious PyPI package incidents and there will be plenty more. 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 w…

I think a big problem with the node ecosystem is the lack of standard library. When I'm developing on PHP, Python, or go, they have a vast standard library that means the likelihood of me using a third-party package is relatively low for the most mundane stuff. Comparing that to node, and you'll need to use an npm package for just about anything. This automatically gives you a much larger attack surface. If I understand correctly Deno is supposed to address that, but I have yet to play with it, so not sure how it works.

Re: Show HN: GitHub style split diffs in your terminal

#38
post #24

When I find myself wanting a split diff in the terminal, I tend to gravitate towards just using Vim’s built in diff mode via vim-fugitive. I even have some git aliases that will open vim and and show fugitive diffs for every file changed on the current branch. The 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…

You and I have similar setups! I love it, but there's one thorn that I've not been able to figure out yet.

Have you (or anyone reading this) been able to figure out how to get diff-highlight to be more intelligent so that if 'foo' changes to "foo", the highlighter is smart enough to only highlight the quotes as changing, but not the word foo? (Though this example is trivial, any time you've got two changes on the same line, this issue occurs where everything in between those changes gets highlighted as well.) I noticed that other tools in this thread such as delta and banga don't suffer from this issue.

Re: Show HN: GitHub style split diffs in your terminal

#39

Earlier quoted context omitted.

This is illusory safety. The exact same risks are present in PyPI. There've been plenty of notorious malicious PyPI package incidents and there will be plenty more. 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 w…

I think a big problem with the node ecosystem is the lack of standard library. When I'm developing on PHP, Python, or go, they have a vast standard library that means the likelihood of me using a third-party package is relatively low for the most mundane stuff. Comparing that to node, and you'll need to use an npm package for just about anything. This automatically gives you a much larger attack surface. If I underst…

Definitely a valid counter-point. I'm sure for that and several other reasons, the Node package ecosystem is probably indeed the riskiest of the set. But it's still really foolish for the parent just immediately turn their nose in disgust simply at the sight of a package.json file.

Or to say "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", which is just completely untrue and misguided in a lot of ways. It's absolutely just as easy for anyone to backdoor a Python package as it is to backdoor an NPM package, and it happens all the time. It's possible it could happen a lot more frequently in the future, too.

You could argue that statement's true in a sense, but given that same sense it's also true of Node; it's not a good way of thinking about dependency supply chain attacks.

Re: Show HN: GitHub style split diffs in your terminal

#40
post #5

I already use delta for this: https://github.com/dandavison/delta I thought delta was fairly well-known by now so I was surprised to see this project not mention it (the readme already has a section for that). I wonder what they've chosen to do differently, besides write it in Node.js.

I would much rather use this, a nice secluded statically compiled blob instead of letting node.js unspool a spaghetti of dependencies.
Post reply on HN