From ef35dbfafd2d27af357d105221fbc491018a7059 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 13 Jul 2025 13:46:35 +0200 Subject: checkpoint --- bin/common/gt | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'bin/common/gt') 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) -- cgit v1.2.3-70-g09d2