Change hint to show whole branch name.

This commit is contained in:
Ian Rettig
2023-03-22 11:17:59 -04:00
parent c5d1a21d20
commit 3bdcd46615
+24 -4
View File
@@ -23,13 +23,10 @@ user_host() {
fi
}
# needs fixed to show develop tag possibly
git_hint() {
git rev-parse 2>/dev/null
if [ $? == 0 ]; then
CMD=`git branch --show-current`
HINT=$(echo -n $(echo -n "$CMD" | grep -oP '\w+-\d+') | cut -d " " -f 1) || HINT=$(echo -n "$CMD")
HINT=$HINT | tr '\n' '\0'
HINT=`git branch --show-current`
echo "($HINT)"
fi
@@ -169,3 +166,26 @@ fi
# allow core files.
ulimit -S -c unlimited
# ssh agent set up
env=~/.ssh/agent.env
agent_load_env () { test -f "$env" && . "$env" >| /dev/null ; }
agent_start () {
(umask 077; ssh-agent >| "$env")
. "$env" >| /dev/null ; }
agent_load_env
# agent_run_state: 0=agent running w/ key; 1=agent w/o key; 2= agent not running
agent_run_state=$(ssh-add -l >| /dev/null 2>&1; echo $?)
if [ ! "$SSH_AUTH_SOCK" ] || [ $agent_run_state = 2 ]; then
agent_start
ssh-add
elif [ "$SSH_AUTH_SOCK" ] && [ $agent_run_state = 1 ]; then
ssh-add
fi
unset env