From 940ab2e8450ec65bb25f4746bdc216e190c3cf3e Mon Sep 17 00:00:00 2001 From: DarkWiiPlayer Date: Fri, 17 Jul 2020 13:44:59 +0200 Subject: [PATCH] Add git-pending script --- bin/git-pending | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 bin/git-pending diff --git a/bin/git-pending b/bin/git-pending new file mode 100755 index 0000000..45f6efa --- /dev/null +++ b/bin/git-pending @@ -0,0 +1,18 @@ +#!/bin/sh + +for line in $@ +do + dir=$(pwd) + cd "$line" + if git log -0 2>/dev/null + then + stat=$(git branch -vv | grep -P '^\*' | grep -Po '\[.*\]') + if echo $stat | grep -P 'behind' > /dev/null + then echo behind $line + fi + if echo $stat | grep -P 'ahead' > /dev/null + then echo ahead $line + fi + fi + cd $dir +done