summaryrefslogtreecommitdiffstats
path: root/.local/bin/confgit.sh
diff options
context:
space:
mode:
authorTyler Davis <tyler@gluecode.net>2024-04-19 22:13:38 +0000
committerTyler Davis <tyler@gluecode.net>2024-04-19 22:13:38 +0000
commitc93221d83e9ea07c7e69ebf7f15ec42ea81fe289 (patch)
treebeb73d88f9ccf1093ab61865a43cad22f2e03a1e /.local/bin/confgit.sh
parent44afca8dabac92c1b9358da59a9759465566c147 (diff)
downloaddotfiles-c93221d83e9ea07c7e69ebf7f15ec42ea81fe289.tar.gz
dotfiles-c93221d83e9ea07c7e69ebf7f15ec42ea81fe289.zip
bin: shfmt all scripts
Diffstat (limited to '.local/bin/confgit.sh')
-rwxr-xr-x.local/bin/confgit.sh140
1 files changed, 70 insertions, 70 deletions
diff --git a/.local/bin/confgit.sh b/.local/bin/confgit.sh
index 64c7927..8fbf0ed 100755
--- a/.local/bin/confgit.sh
+++ b/.local/bin/confgit.sh
@@ -4,26 +4,26 @@
OS="$(uname -s)"
NPROCS=""
if [ "$OS" = "Linux" ]; then
- DETPROCS="$(nproc --all)"
+ DETPROCS="$(nproc --all)"
elif [ "$OS" = "Darwin" ] || [ "$(echo "$OS" | grep -q BSD)" = "BSD" ]; then
- DETPROCS="$(sysctl -n hw.ncpu)"
+ DETPROCS="$(sysctl -n hw.ncpu)"
else
- DETPROCS="$(getconf _NPROCESSORS_ONLN)" # glibc/coreutils fallback
+ DETPROCS="$(getconf _NPROCESSORS_ONLN)" # glibc/coreutils fallback
fi
if [ $DETPROCS -gt 16 ]; then
- NPROCS="$(($DETPROCS / 2))"
+ NPROCS="$(($DETPROCS / 2))"
else
- NPROCS="$DETPROCS"
+ NPROCS="$DETPROCS"
fi
if [ ! $(command -v git) ]; then
- echo "git not installed";
- exit 1
+ echo "git not installed"
+ exit 1
fi
if [ -e $HOME/.gitconfig ]; then
- rm $HOME/.gitconfig # Purge existing gitconf
+ rm $HOME/.gitconfig # Purge existing gitconf
fi
# Dotfiles config
@@ -37,9 +37,9 @@ git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME config status.showUntrackedFile
# Main Git Config
git config --global am.messageid true
git config --global branch.sort -committerdate
-git config --global checkout.defaultRemote origin # Default to using the "origin" remote
+git config --global checkout.defaultRemote origin # Default to using the "origin" remote
git config --global checkout.thresholdForParallelism 50 # Default 100 files
-git config --global checkout.workers "$NPROCS" # Auto-detect threads from CPU
+git config --global checkout.workers "$NPROCS" # Auto-detect threads from CPU
git config --global commit.verbose true
git config --global core.commitgraph true
git config --global core.excludesfile "$HOME/.local/share/git/ignore_global"
@@ -92,83 +92,83 @@ git config --global mergetool.vscode.cmd "code --wait \$MERGED"
# Editors
if [ "$(command -v code)" ] && [ "$(env | grep VSCODE)" ]; then
- export EDITOR="code"
- export VISUAL="code"
- git config --global core.editor "code --wait"
- git config --global diff.tool vscode
- git config --global merge.tool vscode
+ export EDITOR="code"
+ export VISUAL="code"
+ git config --global core.editor "code --wait"
+ git config --global diff.tool vscode
+ git config --global merge.tool vscode
elif [ -d "$HOME/.config/doom" ] && [ "$(command -v emacs)" ]; then
- export EDITOR="emacs"
- export VISUAL="emacs"
- export PATH=$PATH:$HOME/.config/emacs/bin
+ export EDITOR="emacs"
+ export VISUAL="emacs"
+ export PATH=$PATH:$HOME/.config/emacs/bin
elif [ "$(command -v hx)" ]; then
- export EDITOR="hx"
- export VISUAL="hx"
- git config --global core.editor hx
- # Still can't find whether helix supports merge contents
- git config --global diff.tool vim
- git config --global merge.tool vim
+ export EDITOR="hx"
+ export VISUAL="hx"
+ git config --global core.editor hx
+ # Still can't find whether helix supports merge contents
+ git config --global diff.tool vim
+ git config --global merge.tool vim
else
- export EDITOR="vim"
- export VISUAL="vim"
- git config --global core.editor vim
- git config --global diff.tool vim
- git config --global merge.tool vim
+ export EDITOR="vim"
+ export VISUAL="vim"
+ git config --global core.editor vim
+ git config --global diff.tool vim
+ git config --global merge.tool vim
fi
# Use pager for large diffs
git config --global pager.difftool true
if [ "$(command -v difft)" ]; then
- git config --global alias.dft difftool
- git config --global diff.external difft
+ git config --global alias.dft difftool
+ git config --global diff.external difft
fi
# Git configs applied to folder groups
if [ "$(command -v fd)" ]; then
- if [ -d $HOME/.code/hpe ]; then
- fd -H -t d -E mod -E vendor '.git$' $HOME/.code/hpe -x bash -c "cd {//}; git config user.email tdavis@hpe.com; git config http.cookiefile $HOME/.local/share/git/cookies-work;"
- fi
- if [ -d $HOME/.code/gluecode ]; then
- fd -H -t d -E mod -E vendor '.git$' $HOME/.code/gluecode -x bash -c "cd {//}; git config user.email tyler@gluecode.com;"
- fi
- if [ -d $HOME/.code/phoenix ]; then
- fd -H -t d -E mod -E vendor '.git$' $HOME/.code/phoenix -x bash -c "cd {//}; git config user.email tyler@gluecode.com;"
- fi
+ if [ -d $HOME/.code/hpe ]; then
+ fd -H -t d -E mod -E vendor '.git$' $HOME/.code/hpe -x bash -c "cd {//}; git config user.email tdavis@hpe.com; git config http.cookiefile $HOME/.local/share/git/cookies-work;"
+ fi
+ if [ -d $HOME/.code/gluecode ]; then
+ fd -H -t d -E mod -E vendor '.git$' $HOME/.code/gluecode -x bash -c "cd {//}; git config user.email tyler@gluecode.com;"
+ fi
+ if [ -d $HOME/.code/phoenix ]; then
+ fd -H -t d -E mod -E vendor '.git$' $HOME/.code/phoenix -x bash -c "cd {//}; git config user.email tyler@gluecode.com;"
+ fi
else
- if [ -d $HOME/.code/hpe ]; then
- find $HOME/.code/hpe -name ".git" -exec bash -c "cd {}; git config user.email tdavis@hpe.com; git config http.cookiefile $HOME/.local/share/git/cookies-work;" \;
- fi
- if [ -d $HOME/.code/gluecode ]; then
- find $HOME/.code/gluecode -name ".git" -exec bash -c "cd {}; git config user.email tyler@gluecode.net;" \;
- fi
- if [ -d $HOME/.code/phoenix ]; then
- find $HOME/.code/phoenix -name ".git" -exec bash -c "cd {}; git config user.email tyler@gluecode.net;" \;
- fi
+ if [ -d $HOME/.code/hpe ]; then
+ find $HOME/.code/hpe -name ".git" -exec bash -c "cd {}; git config user.email tdavis@hpe.com; git config http.cookiefile $HOME/.local/share/git/cookies-work;" \;
+ fi
+ if [ -d $HOME/.code/gluecode ]; then
+ find $HOME/.code/gluecode -name ".git" -exec bash -c "cd {}; git config user.email tyler@gluecode.net;" \;
+ fi
+ if [ -d $HOME/.code/phoenix ]; then
+ find $HOME/.code/phoenix -name ".git" -exec bash -c "cd {}; git config user.email tyler@gluecode.net;" \;
+ fi
fi
# Git LFS support
if [ $(command -v git-lfs) ]; then
- # Only install if we don't detect existing LFS entries, which should
- # always be true on a fresh run
- if [ $(git config -l|grep -c lfs) -lt 1 ]; then
- # Redirect output to null - silence "Git LFS installed" messages
- #git lfs install > /dev/null
- git config --global --includes --replace-all filter.lfs.clean "git-lfs clean -- %f"
- fi
+ # Only install if we don't detect existing LFS entries, which should
+ # always be true on a fresh run
+ if [ $(git config -l | grep -c lfs) -lt 1 ]; then
+ # Redirect output to null - silence "Git LFS installed" messages
+ #git lfs install > /dev/null
+ git config --global --includes --replace-all filter.lfs.clean "git-lfs clean -- %f"
+ fi
fi
-case `uname` in
- Darwin)
- git config --global credential.helper osxkeychain
- ;;
- Linux)
- git config --global credential.helper "store --file=/home/tydavis/.config/gitcreds"
- # Email configuration for `git send-email` command - default Gluecode
- git config --global sendemail.annotate yes # Review and edit each patch
- git config --global sendemail.confirm auto
- git config --global sendemail.smtpserver /usr/bin/msmtp
- ;;
- FreeBSD)
- # commands for FreeBSD go here
- ;;
+case $(uname) in
+Darwin)
+ git config --global credential.helper osxkeychain
+ ;;
+Linux)
+ git config --global credential.helper "store --file=/home/tydavis/.config/gitcreds"
+ # Email configuration for `git send-email` command - default Gluecode
+ git config --global sendemail.annotate yes # Review and edit each patch
+ git config --global sendemail.confirm auto
+ git config --global sendemail.smtpserver /usr/bin/msmtp
+ ;;
+FreeBSD)
+ # commands for FreeBSD go here
+ ;;
esac