grep — Git & Multi-Repo

git grep

Search commit messages for a keyword
git log --oneline --all --grep='fix' | head -10
Search commit messages with regex
git log --oneline --all --grep='feat\|fix\|refactor' --extended-regexp | head -10
git grep — search tracked files (faster than grep -r in repos)
git grep -n 'attribute-missing' -- '*.adoc'
git grep with context
git grep -n -C3 'kb_layout' -- '*.conf'
Search across all branches
git grep 'domus-literature' $(git branch -a --format='%(refname)')
Find when a line was added — git log -S (pickaxe)
git log -S 'port-gc' --oneline -- docs/antora.yml
Find when a line was deleted
git log -S 'la-reina-valera.adoc' --oneline --diff-filter=D
Blame a specific line — who last touched it
git blame -L 119,119 ~/.config/hypr/hyprland.conf

Multi-Repo Patterns

Antora component names across all spokes
grep -rh '^name:' ~/atelier/_bibliotheca/domus-*/docs/*/antora.yml \
                   ~/atelier/_bibliotheca/domus-*/docs/antora.yml 2>/dev/null | sort -u
Find a pattern across ALL domus repos
for d in ~/atelier/_bibliotheca/domus-*/; do
  result=$(grep -rlP 'kb_layout' "$d" --include='*.adoc' 2>/dev/null)
  [ -n "$result" ] && echo "$(basename $d): $result"
done
Cross-component xrefs in domus-captures
grep -rnP 'xref:\w+::' --include='*.adoc' ~/atelier/_bibliotheca/domus-captures/docs/modules/ROOT/pages/
Find which repos have uncommitted changes
for d in ~/atelier/_bibliotheca/domus-*/; do
  changes=$(git -C "$d" status --porcelain 2>/dev/null | wc -l)
  [ "$changes" -gt 0 ] && echo "$(basename $d): $changes files"
done
Find which repos are ahead of remote
for d in ~/atelier/_bibliotheca/domus-*/; do
  ahead=$(git -C "$d" rev-list --count @{upstream}..HEAD 2>/dev/null)
  [ "$ahead" -gt 0 ] && echo "$(basename $d): $ahead commits ahead"
done
Total adoc pages across all spokes
find ~/atelier/_bibliotheca/domus-*/docs -name '*.adoc' -path '*/pages/*' | wc -l