dot/gitconfig.in: Add rune to run a command in all modules.
authorMark Wooding <mdw@distorted.org.uk>
Wed, 11 Sep 2019 16:50:49 +0000 (17:50 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 11 Sep 2019 16:50:49 +0000 (17:50 +0100)
For some daft reason, `git submodule foreach' won't run the command in
the top-level working tree.

dot/gitconfig.in

index 9d95d2a..69cca7f 100644 (file)
        diff = perl /usr/share/doc/git/contrib/diff-highlight/diff-highlight | mdw-pager
 
 [alias]
+       do = "!sh -e -c ' \
+               quiet=; \
+               case $#,$1 in 0, | *,*,*) ;; *,-q) quiet=--quiet; shift ;; esac; \
+               case $quiet in ?*) ;; *) echo \"Entering toplevel\" ;; esac; \
+               (name=\"<toplevel>\"; path=.; toplevel=$(pwd); \
+                sha1=$(git rev-parse HEAD); \
+                set +e; case $# in 1) eval \"$1\" ;; *) \"$@\" ;; esac); \
+               exec git submodule $quiet foreach --recursive \"$@\"' do"
        egrep = "grep -E"
        graph = "log --pretty=oneline --abbrev-commit --graph"
        release = !"sh -e -c ' \