dotfiles

Obligatory dotfiles repo
git clone git://git.danielmoch.com/dotfiles.git
Log | Files | Refs

commit ff400931f84a47fda6cada73ead0ce3f97a58494
parent 186b3270f26cb7ee3b8df086f648971cf6002cf4
Author: Daniel Moch <daniel@danielmoch.com>
Date:   Tue, 17 Sep 2019 05:11:08 -0400

Better git rev-parsing for $PS1

Diffstat:
M.shrc | 7++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/.shrc b/.shrc @@ -19,7 +19,12 @@ __ps1() { then if git rev-parse --show-toplevel > /dev/null 2>&1 then - echo " ($(git rev-parse --abbrev-ref HEAD))" + gitref=$(git rev-parse --abbrev-ref HEAD) + if [ $gitref = HEAD ] + then + gitref=\($(git rev-parse --short HEAD)\) + fi + echo " ($gitref)" else echo fi