summaryrefslogtreecommitdiff
path: root/bin/common
diff options
context:
space:
mode:
authorRaymaekers Luca <luca@spacehb.net>2025-07-13 13:46:35 +0200
committerRaymaekers Luca <luca@spacehb.net>2025-07-13 13:46:35 +0200
commitef35dbfafd2d27af357d105221fbc491018a7059 (patch)
tree6d27f626c7ebeb3fcd1bf7815fce9760e8f59715 /bin/common
parent1910697d0291570b410ab4df757d6a2f5241ee66 (diff)
checkpoint
Diffstat (limited to 'bin/common')
-rwxr-xr-xbin/common/gt23
1 files changed, 21 insertions, 2 deletions
diff --git a/bin/common/gt b/bin/common/gt
index 2fb5840..d6b19f9 100755
--- a/bin/common/gt
+++ b/bin/common/gt
@@ -24,6 +24,7 @@ help() {
usage: gt [OPTION]
-a PATH add repo
-c COMMAND run 'git COMMAND' in each repo
+-d be done in every project
-h show this help
-l list repos
-e edit repos in \$EDITOR
@@ -57,7 +58,7 @@ if [ -z "$1" ]; then
fi
-while getopts ":a:c:f:lsheu" opt; do
+while getopts ":a:c:f:dlsheu" opt; do
case "$opt" in
a)
if ! cd "$OPTARG" 2>/dev/null; then
@@ -87,7 +88,25 @@ while getopts ":a:c:f:lsheu" opt; do
xargs -I{} gt-cmd "{}" "$OPTARG"
fi
;;
- s)
+ d)
+ if [ "$parallel" ]; then
+ list_repos |
+ parallel 'cd {}; cd "$(git rev-parse --show-toplevel || echo .)"; git pull --ff; git add .;git commit --all -m "checkpoint";git push'
+ else
+ list_repos | while read -r proj
+ do
+ (
+ cd "$proj"
+ cd "$(git rev-parse --show-toplevel || printf '.\n')"
+ git pull --ff
+ git add .
+ git commit --all -m "checkpoint"
+ git push
+ )
+ done
+ fi
+ ;;
+ s)
quit_when_no_repos
list_repos | xargs -I{} gt-st {} ;;
l)