Browsing through twitter the other day I discovered it through this tweet by _darrenburns .
Ok, here's what I've been building today 👇— Darren Burns 🌱 (@_darrenburns) April 2, 2022
Pipe the output of 'git diff' into dunk and you'll get a GitHub style side-by-side diff right in your terminal. https://t.co/al5y68YSda pic.twitter.com/LLOcaNhpyP
Before I dive in deep, I do want to mention that Dunk is super new and beta at this point. I am making it my default pager, because I know what I am doing and can quickly shift back if I need to, no sweat. If you are a little less comfortable with the command line, terminal, or reading any issues that might come up, it might be best if you just pipe into Dunk when you want to use it.
The author really cautions the use of it as your default pager this early, I'm just showing that it's possible, and I'm trying it.
He notes that it might have some issues especially with partially staged files.
You can try it with pipx.
git diff | pipx run dunk
If you like it, you can install it with pip or pipx, I prefer pipx for cli applications like this.
pipx install dunk
You can configure dunk as your default pager with the command line, or
by editing your
git config --global pager.diff "dunk | less -R`
[pager] diff = dunk | less -R
your pager configuration from the command line or edit
file by hand to remove the lines shown above.
git config --global --unset pager.diff
I have some edits to a game my son and I are working on unstaged so I
on that project with and without dunk to compare the
Dunk just looks so good.
If you follow along here often you know that I am a big fan of installing all my tools in an ansible playbook so that I don't suffer configuring a new machine for months after getting it and wondering why its not exactly like the last.
# Dunk - prettier git diffs # https://github.com/darrenburns/dunk - name: check is dunk installed shell: command -v black register: dunk_exists ignore_errors: yes - name: install dunk when: dunk_exists is failed shell: pipx install dunk
More on conditionally installing tools with ansible in this post.