diff --git a/bash/bashrc/rbashrc b/bash/bashrc/rbashrc index efd85c6..4ca6df8 100644 --- a/bash/bashrc/rbashrc +++ b/bash/bashrc/rbashrc @@ -211,6 +211,7 @@ function __ns { __ns "package.sh" 1 __ns "10_aliases" +__ns "12_shortcuts" __ns "20_fast-greps" __ns "30_mysql" __ns "40_go-command" diff --git a/bash/bashrc/sources/12_shortcuts b/bash/bashrc/sources/12_shortcuts new file mode 100755 index 0000000..0767d74 --- /dev/null +++ b/bash/bashrc/sources/12_shortcuts @@ -0,0 +1,16 @@ +#!/bin/bash + +function git-config-as { + local SHA NAME EMAIL + SHA=$1 + if [ -z "$1" ]; then + SHA=HEAD + fi + NAME=$( git log $SHA -1 --pretty=format:%aN ) + EMAIL=$( git log $SHA -1 --pretty=format:%ae ) + + git config user.name "$NAME" + git config user.email "$EMAIL" + echo "Configured as \"$NAME <$EMAIL>\"" +} +