feat: add nbdime

This commit is contained in:
Daniel Bauer
2026-04-17 10:32:22 +02:00
parent 3179c0b2b9
commit 77d8f02e0d
3 changed files with 31 additions and 2 deletions

View File

@@ -7,7 +7,7 @@
pager = sh -c 'command -v diff-so-fancy >/dev/null && exec diff-so-fancy || less --tabs=4 -RX' pager = sh -c 'command -v diff-so-fancy >/dev/null && exec diff-so-fancy || less --tabs=4 -RX'
pager = less pager = less
autocrlf = input autocrlf = input
attributesFile = /home/dbauer/.gitattributes attributesFile = {{ .chezmoi.homeDir }}/.gitattributes
[alias] [alias]
co = commit co = commit
ch = checkout ch = checkout
@@ -56,3 +56,16 @@
program = /usr/bin/gpg program = /usr/bin/gpg
[include] [include]
path = ~/.gitconfig.local path = ~/.gitconfig.local
[diff "jupyternotebook"]
command = git-nbdiffdriver diff
[merge "jupyternotebook"]
driver = git-nbmergedriver merge %O %A %B %L %P
name = jupyter notebook merge driver
[difftool "nbdime"]
cmd = git-nbdifftool diff \"$LOCAL\" \"$REMOTE\" \"$BASE\"
[difftool]
prompt = false
[mergetool "nbdime"]
cmd = git-nbmergetool merge \"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\"
[mergetool]
prompt = false

View File

@@ -6,7 +6,7 @@ echo "Installing packages"
echo "Updating sources..." echo "Updating sources..."
sudo apt update -qq sudo apt update -qq
for package in zsh xsel unzip git git-extras neovim git ripgrep; do for package in zsh xsel unzip git git-extras neovim git ripgrep pipx; do
if dpkg -s "$package" >/dev/null 2>&1; then if dpkg -s "$package" >/dev/null 2>&1; then
echo $package is already installed. echo $package is already installed.
else else

View File

@@ -0,0 +1,16 @@
#!/usr/bin/env bash
set -e
# Install nbdime using pipx
if ! command -v pipx &> /dev/null; then
echo "pipx not found. failed to install nbdime"
exit 1
fi
if pipx list | grep -q nbdime; then
echo "nbdime already installed. skipping."
exit 0
fi
echo "Installing nbdime"
pipx install nbdime