home | list info | list archive | date index | thread index

Re: [OCLUG-Tech] acceptable bourne shell function names

  • Subject: Re: [OCLUG-Tech] acceptable bourne shell function names
  • From: Bart Trojanowski <bart [ at ] jukie [ dot ] net>
  • Date: Tue, 30 Jun 2009 22:01:43 -0400
* Michael P. Soulier <msoulier [ at ] digitaltorque [ dot ] ca> [090630 21:48]:
> git_dirstatus()
> {
>     if which git 1>/dev/null 2>&1
>     then
>         for dir in *
>         do
>             if [ -d $dir/.git ]; then
>                 echo "Checking $dir"
>                 (cd $dir && git status)
>                 echo
>             fi
>         done
>     else
>         echo "No git found in PATH!" 1>&2
>     fi
> }

See if this works for you...

git config --global alias.dirstatus '!ls -d1 */.git | xargs -n1 -i{} sh -c "cd {}/.. && echo Checking {} && git ls-files --exclude-standard -tousmd"'  

I took the liberty to using git ls-files instead of git status.  Feel
free to change it back to use git-status if you like it more :)

-Bart

-- 
				WebSig: http://www.jukie.net/~bart/sig/