From fcdbb2d7baeca8f035983abdaad1c2b257a8c63f Mon Sep 17 00:00:00 2001 From: Iristyle Date: Mon, 18 Mar 2013 20:59:42 -0400 Subject: [PATCH] feat(gitaliases): Sniff out current user for standup --- EthanBrown.GitAliases/EthanBrown.GitAliases.nuspec | 2 +- EthanBrown.GitAliases/tools/chocolateyInstall.ps1 | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/EthanBrown.GitAliases/EthanBrown.GitAliases.nuspec b/EthanBrown.GitAliases/EthanBrown.GitAliases.nuspec index 3ecbe19..5d6a467 100644 --- a/EthanBrown.GitAliases/EthanBrown.GitAliases.nuspec +++ b/EthanBrown.GitAliases/EthanBrown.GitAliases.nuspec @@ -18,7 +18,7 @@ last = log -p --max-count=1 --word-diff pick = add -p stage = add - standup = log --since yesterday --oneline --author Iristyle + standup = log --since yesterday --oneline --author {ME} stats = diff --stat sync = ! git fetch upstream -v && git fetch origin -v && git checkout master && git merge upstream/master undo = reset head~ diff --git a/EthanBrown.GitAliases/tools/chocolateyInstall.ps1 b/EthanBrown.GitAliases/tools/chocolateyInstall.ps1 index b0716e6..f30d1c6 100644 --- a/EthanBrown.GitAliases/tools/chocolateyInstall.ps1 +++ b/EthanBrown.GitAliases/tools/chocolateyInstall.ps1 @@ -15,7 +15,15 @@ try { git config --global alias.last 'log -p --max-count=1 --word-diff' git config --global alias.pick 'add -p' git config --global alias.stage 'add' - git config --global alias.standup 'log --since yesterday --oneline --author Iristyle' + $userName = git config --global --get user.name + if ($userName) + { + git config --global alias.standup "log --since yesterday --oneline --author $userName" + } + else + { + Write-Warning "Set git global username with git config --global user.name 'foo' to use standup" + } git config --global alias.stats 'diff --stat' git config --global alias.sync '! git fetch upstream -v && git fetch origin -v && git checkout master && git merge upstream/master' git config --global alias.undo 'reset head~'