summaryrefslogtreecommitdiff
path: root/bash/git.bash
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2020-02-26 13:48:33 +0100
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2020-02-26 13:48:33 +0100
commit178ffef0226b45ad4b1862c7e9223cd539788bcc (patch)
tree765e23862f50479dd48ab312f6cb9aa0fa202a86 /bash/git.bash
parent724bb024d49f2883c186e80a016abd9b956bba96 (diff)
downloaddotfiles-178ffef0226b45ad4b1862c7e9223cd539788bcc.tar.gz
removed bashit
Diffstat (limited to 'bash/git.bash')
-rw-r--r--bash/git.bash8
1 files changed, 8 insertions, 0 deletions
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 "^??")
+}