From: Mark Wooding Date: Wed, 11 Sep 2019 16:50:49 +0000 (+0100) Subject: dot/gitconfig.in: Add rune to run a command in all modules. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/profile/commitdiff_plain/71c95f6fb2bf0d4dd903db05ae0f90f9d96591c9 dot/gitconfig.in: Add rune to run a command in all modules. For some daft reason, `git submodule foreach' won't run the command in the top-level working tree. --- diff --git a/dot/gitconfig.in b/dot/gitconfig.in index 9d95d2a..69cca7f 100644 --- a/dot/gitconfig.in +++ b/dot/gitconfig.in @@ -92,6 +92,14 @@ 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=\"\"; 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 ' \