4 ms·
While everyone is here considering their life choices (at least as far as they relate to ~/.gitconfig), highly recommend delta [1] as a companion to the git cl
by _kb 2y ago
While everyone is here considering their life choices (at least as far as they relate to ~/.gitconfig), highly recommend delta [1] as a companion to the git cli.
[1]: https://dandavison.github.io/delta/ https://dandavison.github.io/delta/
- schacon 2y agoI really wanted to add this (I linked it in the last paragraph) but I really wanted to keep the recommendations globally applicable in vanilla git. Delta is awesome though.
- leonheld 2y agoAfter using delta for a while, I'm going back to the regular diff view... it's not that it isn't good, but I'm constantly copying diffs (yes, I know I can generate patches) and the pretty output breaks that workflow. Also, when your terminal is a bit small it's a bit hard to see things. But it's really good software, I recommend anyone who's reading to give it a try.
- JadedBlueEyes 2y agoIIRC if you pipe the output to, e.g, xclip, or redirect to a file it will give the original diff format. Not as convenient, but still workable.
- leonheld 2y agoI... did not know that! Yep yep that should do the trick for me. Thanks a lot, actually!
- mplanchard 2y agoMost tools that do formatted output, if they’re well-behaved, should try to detect if their output is a pipe and if so, disable formatting. Some examples that I can think of off the top of my head (in addition to git) are ripgrep and jq, both of which do the right thing and strip formatting.
- knome 2y agorather they should detect that output is a terminal and enable the coloring
- pca006132 2y agoWow I never knew this, I always just type `--no-ext-diff` when piping the output. Thanks!
- ramses0 2y ago`... | cat` is sometimes really handy (and universal)
- lucasoshiro 2y agoI use git -c core.pager = less, but piping seems to be a less verbose option... hmmm I'll try it
- rusk 2y agoPipe through cat should work
- PhilippGille 2y agoIsn't copying without the formatting just a `<your diff command> | pbcopy` away?
- genewitch 2y agoI have Gemini set to decipher HN comments that I don't immediately understand. This is a macos only command `pbcopy`? Aside: Gemini mentioned it didn't want me to ask it questions about bikeshedding what shade of blue on a website header so I think it's got our number.
- chuckadams 2y agoYes pbcopy is a mac thing. On Linux, there are of course many different commands in different environments/distros. xsel, xclip, wl-clipboard, wlclip to name a few. On windows, powershell has Get-Clipboard and Set-Clipboard, and cmd.exe has `wsl` to fix the issue of having used cmd.exe to begin with.
- Macha 2y agoThough, if you have a preferred shade of blue, you can actually use it for the HN header in your user settings.
- mplanchard 2y agoIf you’re an emacser, you can even use delta with magit via the same author’s magit-delta package: https://github.com/dandavison/magit-delta https://github.com/dandavison/magit-delta Looks like there are also instructions in the docs for using it with vscode