diff --git a/dotfiles/gitconfig b/dotfiles/gitconfig index a5a5200..1683559 100644 --- a/dotfiles/gitconfig +++ b/dotfiles/gitconfig @@ -1,7 +1,6 @@ [user] name = David Tomaschik - email = david@systemoverlord.com - signingKey = 0x5DEA789B + useConfigOnly = true [core] excludesfile = ~/.gitignore @@ -73,9 +72,6 @@ [mergetool] prompt = false -[include] - path = ~/.gitconfig.local - [pull] rebase = false @@ -94,3 +90,10 @@ clean = git-lfs clean -- %f smudge = git-lfs smudge -- %f process = git-lfs filter-process + +[include] + path = ~/.gitconfig.d/override + path = ~/.gitconfig.d/local + +[includeIf "gitdir:~/personal/"] + path = ~/.gitconfig.d/personal diff --git a/dotfiles/gitconfig.d/override b/dotfiles/gitconfig.d/override new file mode 100644 index 0000000..3b6d078 --- /dev/null +++ b/dotfiles/gitconfig.d/override @@ -0,0 +1,5 @@ +[user] + email = david@systemoverlord.com + +[github] + user = matir diff --git a/dotfiles/gitconfig.d/personal b/dotfiles/gitconfig.d/personal new file mode 100644 index 0000000..4e8efb1 --- /dev/null +++ b/dotfiles/gitconfig.d/personal @@ -0,0 +1,2 @@ +[user] + email = david@systemoverlord.com diff --git a/install.sh b/install.sh index 1398dca..657d86f 100755 --- a/install.sh +++ b/install.sh @@ -126,31 +126,6 @@ install_keys() { install_known_hosts } -setup_git_email() { - local gc_local="${HOME}/.gitconfig.local" - local current_email="" - - if [[ -f "${gc_local}" ]]; then - current_email=$(git config -f "${gc_local}" user.email || true) - fi - - if [[ -n "${GIT_EMAIL:-}" ]]; then - # Use environment variable - git config -f "${gc_local}" user.email "${GIT_EMAIL}" - elif [[ -n "${current_email}" ]]; then - # Already has an email set - GIT_EMAIL="${current_email}" - else - # Prompt the user - echo -n "Enter git email (leave blank to skip): " >&2 - read -r GIT_EMAIL || true - if [[ -n "${GIT_EMAIL}" ]]; then - git config -f "${gc_local}" user.email "${GIT_EMAIL}" - fi - fi - export GIT_EMAIL -} - read_saved_prefs() { # Can't use basedir here as we don't have it yet local pref_file="$(dirname "$0")/.installed-prefs" @@ -252,7 +227,6 @@ install_main() { link_directory_contents "${BASEDIR}/bin" "${HOME}/bin" "" [[ "$INSTALL_KEYS" = 1 ]] && install_keys save_prefs - setup_git_email cleanup }