g: use python to pass args transparently

Change-Id: Ib02058a73d2959c5ea5073924b2c38195bbe08fc
This commit is contained in:
Neels Hofmeyr 2017-11-17 02:15:16 +01:00
parent a19ed1f2d6
commit 9316ee7810
1 changed files with 17 additions and 7 deletions

24
src/g
View File

@ -1,7 +1,17 @@
#!/bin/sh
for gitdir in */.git ; do
dir="$(dirname "$gitdir")"
echo
echo "===== $dir ====="
git -C "$dir" $@
done
#!/usr/bin/env python3
import sys
import os
import subprocess
git_subdirs = []
for subdir in os.listdir():
if not os.path.isdir(os.path.join(subdir, '.git')):
continue
print('\n===== %s =====' % subdir)
sys.stdout.flush()
subprocess.call(['git', '-C', subdir] + sys.argv[1:])
sys.stdout.flush()
sys.stderr.flush()