From 4466d5d96081b683eaf9e58e03c048a77962a45b Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sun, 19 Jun 2016 23:51:13 -0700 Subject: [PATCH] Set imalison@uber.com as git email automatically --- dotfiles/lib/shellenv/uber.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/dotfiles/lib/shellenv/uber.sh b/dotfiles/lib/shellenv/uber.sh index 4e36f294..059cb5d3 100644 --- a/dotfiles/lib/shellenv/uber.sh +++ b/dotfiles/lib/shellenv/uber.sh @@ -46,3 +46,17 @@ add_to_path "$HOME/bin" --before alias land_current='arc land $(git which-branch)' alias kill_h_forward='ps aux | grep ssh | grep 21300 | get_cols 2 | xargs kill -9' + +autoload -U add-zsh-hook + +add-zsh-hook precmd uber_set_user_email_to_imalison + +function uber_set_user_email_to_imalison { + if in_git_directory; + then + if [[ "$(git config remote.origin.url)" == *"uber"* ]] + then + git config user.email "imalison@uber.com" + fi + fi +}