It works for me, for what I am doing, but it needs more testing. I have only used it on Win7.
Code is posted at the following gist:
https://gist.github.com/jayrm/b1fbc8199 ... 076fc090d2
Here is an example of the execution & output:
Code: Select all
E:\fb>git dirs --status --recursive
fbtools/cleanrc/
fbtools/dtools/
[master]: files modified (use "git add")
fbtools/gettime/
fbtools/git-dirs/
[single-module]: files modified (use "git add")
[single-module]: files staged (use "git commit")
[single-module]: 1 commit(s) ahead (use "git push")
fbtools/mkvideo/
fbtools/scantree/
fbtools/scantree/libjrm/
fbtools/tmp/
[master]: no upstream branch (use "git push --set-upstream origin master")
fbtools/wakeup/
libjrm/
[master]: 6 commit(s) ahead (use "git push")
E:\fb>git dirs -h
usage: git dirs [options]
-a, --all all directories (except system)
--color[=yes|no] color formatting
-r, --recursive recursive
-s, --sorted sorted
--status query status of each git dir
--fetch perform a 'fetch --all --tags' at each git dir
--system include system directories
-v, --verbose be more verbose
E:\fb>
1) scan directories, recursively if option given
2) If .git folder found; it's a git repo, if .git file fond, it's a git submodule
3) execute some git shell/pipe commands on the git directory to determine the status
4) print the results
Over the years I have created many little utilities and projects. There are a few that I use regularly and I keep maintained. I have been making efforts to organize my source tree because I find that I have so many duplicate copies of similar files. I am using file:////server/share/path.git strategy on a LAN share for the upstream repo's. As I was creating more and more git repos, I needed this utility to help remind me what the state of each repo was.
Hope it is useful.