From 1ed0b55c02c3703a86ad3fb5aedef76a5295c004 Mon Sep 17 00:00:00 2001 From: Chen Asraf Date: Thu, 16 May 2024 13:47:50 +0300 Subject: [PATCH] feat: git pager, move git config to install file --- .config/home/.gitconfig | 39 --------------------------------- .config/lazygit.yml | 2 +- install.sh | 48 +++++++++++++++++++++++++++++++++++++++-- 3 files changed, 47 insertions(+), 42 deletions(-) delete mode 100644 .config/home/.gitconfig diff --git a/.config/home/.gitconfig b/.config/home/.gitconfig deleted file mode 100644 index 83a45e78..00000000 --- a/.config/home/.gitconfig +++ /dev/null @@ -1,39 +0,0 @@ -[user] - name = Chen Asraf - email = casraf@pm.me - signingkey = ~/.ssh/id_casraf.pub -[filter "lfs"] - clean = git-lfs clean -- %f - smudge = git-lfs smudge -- %f - process = git-lfs filter-process - required = true -[init] - defaultBranch = master -[credential] - helper = store -[pull] - rebase = true -[core] - excludesfile = /Users/chen/.config/.gitignore - # untrackedCache = true - # fsmonitor = true -[alias] - unchanged = update-index --assume-unchanged - changed = update-index --no-assume-unchanged - show-unchanged = !"git ls-files -v | sed -e 's/^[a-z] //p; d'" -[rerere] - enabled = true -[gpg] - format = ssh -[gpg "ssh"] - allowedSignersFile = ~/.ssh/allowed_signers -[commit] - gpgsign = true - -[maintenance] - repo = ~/.dotfiles - -[fetch] - writeCommitGraph = true -[log] - showSignature = true diff --git a/.config/lazygit.yml b/.config/lazygit.yml index 11ae11c6..a74cc085 100644 --- a/.config/lazygit.yml +++ b/.config/lazygit.yml @@ -59,7 +59,7 @@ gui: git: paging: colorArg: always - pager: '' + pager: delta --dark --paging=never useConfig: false commit: signOff: false diff --git a/install.sh b/install.sh index b57717b7..861e7e68 100755 --- a/install.sh +++ b/install.sh @@ -40,12 +40,56 @@ if is_mac; then fi echo_yellow "Setting up git..." -git config --global core.excludesfile ~/.config/.gitignore + if ! gpg --list-keys | grep -q "$GITHUB_GPG_KEY_ID"; then curl https://github.com/web-flow.gpg | gpg --import fi -xrg "$DOTFILES/.config/home/.gitconfig $HOME/.gitconfig" "$rsync_template" +git config --global user.name "Chen Asraf" +git config --global user.email "casraf@pm.me" +git config --global user.signingkey "~/.ssh/id_casraf.pub" +git config --global filter.lfs.clean "git-lfs clean -- %f" +git config --global filter.lfs.smudge "git-lfs smudge -- %f" +git config --global filter.lfs.process "git-lfs filter-process" +git config --global filter.lfs.required true +git config --global init.defaultBranch "master" +git config --global credential.helper "store" +git config --global pull.rebase true +git config --global core.excludesfile "~/.config/.gitignore" +# git config --global core.untrackedCache true +# git config --global core.fsmonitor true +git config --global alias.unchanged "update-index --assume-unchanged" +git config --global alias.changed "update-index --no-assume-unchanged" +git config --global alias.show-unchanged "!git ls-files -v | sed -e 's/^[a-z] //p; d'" +git config --global rerere.enabled true +git config --global gpg.format "ssh" +git config --global gpg.ssh.allowedSignersFile "~/.ssh/allowed_signers" +git config --global commit.gpgsign true +git config --global maintenance.repo "~/.dotfiles" +git config --global fetch.writeCommitGraph true +git config --global log.showSignature true +git config --global core.excludesfile ~/.config/.gitignore + +if [[ ! -f $(which delta) ]]; then + if ask "Install delta?"; then + echo_yellow "Installing delta..." + brew install git-delta + fi +fi + +existing_pager=$(git config --global core.pager) + +if [[ -z $existing_pager ]]; then + echo_yellow "Setting up delta as git pager..." + git config --global core.pager delta + git config --global interactive.diffFilter "delta --color-only" + # git config --global delta.side-by-side true + # git config --global delta.navigate true + # git config --global delta.dark true + git config --global merge.conflictStyle diff3 + git config --global delta.line-numbers true + git config --global diff.colorMoved default +fi if [[ -z $(git config --global user.name) ]]; then echo_cyan "Enter your name:"