From 178ffef0226b45ad4b1862c7e9223cd539788bcc Mon Sep 17 00:00:00 2001 From: Jonas Gunz Date: Wed, 26 Feb 2020 13:48:33 +0100 Subject: removed bashit --- bash/git.bash | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 bash/git.bash (limited to 'bash/git.bash') diff --git a/bash/git.bash b/bash/git.bash new file mode 100644 index 0000000..365eac2 --- /dev/null +++ b/bash/git.bash @@ -0,0 +1,8 @@ +# vi:syntax=sh + +function get_git_state () { + local GIT_STATUS=$(git status -bs) + local GIT_BRANCH=$(echo $GIT_STATUS | grep "^## :") + local GIT_CHANGED=$(echo $GIT_STATUS | grep -c "^ M") + local GIT_UNTRACKED=$(echo $GIT_STATUS | grep -c "^??") +} -- cgit v1.2.3