Added git-config-as
This commit is contained in:
parent
e85c9d9b7a
commit
744bfc948f
@ -211,6 +211,7 @@ function __ns {
|
|||||||
|
|
||||||
__ns "package.sh" 1
|
__ns "package.sh" 1
|
||||||
__ns "10_aliases"
|
__ns "10_aliases"
|
||||||
|
__ns "12_shortcuts"
|
||||||
__ns "20_fast-greps"
|
__ns "20_fast-greps"
|
||||||
__ns "30_mysql"
|
__ns "30_mysql"
|
||||||
__ns "40_go-command"
|
__ns "40_go-command"
|
||||||
|
16
bash/bashrc/sources/12_shortcuts
Executable file
16
bash/bashrc/sources/12_shortcuts
Executable file
@ -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>\""
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user