From 27b296ac5c42b9e8e02cc426554eca92a6885950 Mon Sep 17 00:00:00 2001 From: DarkWiiPlayer Date: Sat, 26 Mar 2022 09:19:03 +0100 Subject: [PATCH] Add git find-head command --- bin/git-find-head | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 bin/git-find-head diff --git a/bin/git-find-head b/bin/git-find-head new file mode 100755 index 0000000..3831a62 --- /dev/null +++ b/bin/git-find-head @@ -0,0 +1,16 @@ +#!/bin/sh + +if [ -z "$2" ] +then target="." +else target="$2" +fi + +initial=$(pwd) +for directory in $(find $target -name "$1" -type d) +do + if [ -d "$directory/.git" ]; then + cd $directory + /bin/echo -e "$directory\t$(git log --format="%h" -1)" + cd $initial + fi +done