fix gc and gcm
This commit is contained in:
parent
2420c13326
commit
5e7f99c2ed
@ -350,29 +350,35 @@ function dc {
|
|||||||
function get_ip_of_ssh_hostname {
|
function get_ip_of_ssh_hostname {
|
||||||
ssh -G $1 | awk '/^hostname / { print $2 }'
|
ssh -G $1 | awk '/^hostname / { print $2 }'
|
||||||
}
|
}
|
||||||
function gcn {
|
unalias gc
|
||||||
|
unalias gcm
|
||||||
|
function gc {
|
||||||
while true;do
|
while true;do
|
||||||
typeset -A users
|
users=($GIT_USERS)
|
||||||
users=('1' 'hophacker' '2' 'zhcalvin' '6' 'wsq')
|
for ((i=1; i<=${#users[@]}; i++)) do
|
||||||
for k in "${(@k)users}"; do
|
echo "$i | $users[$i]"
|
||||||
echo "$k || $users[$k]"
|
|
||||||
done
|
done
|
||||||
|
echo 'please input your number or name:'
|
||||||
read input
|
read input
|
||||||
if [[ ! -z $users[$input] ]];then
|
for ((i=1; i<=${#users[@]}; i++)) do
|
||||||
name=$users[$input]
|
if [[ $input == $users[$i] ]];then
|
||||||
break
|
name=$input
|
||||||
else
|
index=$i
|
||||||
for k in "${(@k)users}"; do
|
break 2
|
||||||
if [[ $input == $users[$k] ]];then
|
elif [[ "$input" =~ '^[0-9]+$' ]];then
|
||||||
name=$input
|
if [[ $input -gt 0 && $input -le ${#users[@]} ]];then
|
||||||
|
name=$users[$input]
|
||||||
|
index=$input
|
||||||
break 2
|
break 2
|
||||||
fi
|
fi
|
||||||
done
|
fi
|
||||||
echo 'invalid option...'
|
done
|
||||||
fi
|
echo 'invalid option...'
|
||||||
done
|
done
|
||||||
typeset -A emails
|
emails=($GIT_EMAILS)
|
||||||
emails=('hophacker' 'j' 'zhcalvin' 'c' 'wsq' 'wsq')
|
(git commit --verbose $*) || return
|
||||||
set -x
|
(git commit --amend --author="$name <$emails[$index]>") || return
|
||||||
git commit --amend --author="$name<$emails[$name]@paiyou.co>" $*
|
}
|
||||||
|
function gcm {
|
||||||
|
(gc --message $*) || return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user