Add git find-head command
This commit is contained in:
parent
71c6af7c44
commit
27b296ac5c
1 changed files with 16 additions and 0 deletions
16
bin/git-find-head
Executable file
16
bin/git-find-head
Executable file
|
@ -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
|
Loading…
Reference in a new issue