diff --git a/dot_gitconfig.tmpl b/dot_gitconfig.tmpl index 2451b62..f755e7b 100644 --- a/dot_gitconfig.tmpl +++ b/dot_gitconfig.tmpl @@ -7,7 +7,7 @@ pager = sh -c 'command -v diff-so-fancy >/dev/null && exec diff-so-fancy || less --tabs=4 -RX' pager = less autocrlf = input - attributesFile = /home/dbauer/.gitattributes + attributesFile = {{ .chezmoi.homeDir }}/.gitattributes [alias] co = commit ch = checkout @@ -56,3 +56,16 @@ program = /usr/bin/gpg [include] 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 diff --git a/run_onchange_before_0_install-packages.sh b/run_onchange_before_0_install-packages.sh index 2d74227..26bc92c 100644 --- a/run_onchange_before_0_install-packages.sh +++ b/run_onchange_before_0_install-packages.sh @@ -6,7 +6,7 @@ echo "Installing packages" echo "Updating sources..." 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 echo $package is already installed. else diff --git a/run_onchange_before_26_nbdime.sh b/run_onchange_before_26_nbdime.sh new file mode 100644 index 0000000..9b22586 --- /dev/null +++ b/run_onchange_before_26_nbdime.sh @@ -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