-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgit-tstatus
More file actions
executable file
·27 lines (26 loc) · 875 Bytes
/
git-tstatus
File metadata and controls
executable file
·27 lines (26 loc) · 875 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh
SUBDIRECTORY_OK=Yes
. $(git --exec-path)/git-sh-setup
git for-each-ref --shell --format=\
"refname=%(refname:short) "\
"author=%(authorname) "\
"sha1=%(objectname) "\
"upstream=%(upstream:short)" \
refs/heads | while read daten
do
eval "$daten"
if [ -n "$upstream" ] ; then
ahead=$(git rev-list $upstream..$refname | wc -l)
behind=$(git rev-list $refname..$upstream | wc -l)
echo $refname
echo --------------------
echo " Upstream: "$upstream
echo " Letzter Autor: "$author
echo " Commit-ID "$(git rev-parse --short $sha1)
echo -n " Status: "
[ $ahead -gt 0 ] && echo -n "ahead:"$ahead" "
[ $behind -gt 0 ] && echo -n "behind:"$behind" "
[ $behind -eq 0 ] && [ $ahead -eq 0 ] && echo -n "synchron!"
echo
fi
done