Skip to content

Commit 982ef8f

Browse files
credfetodnyw4l3n13
authored andcommitted
feat: add git/push-all and fix push hook bypass in git/ignore-changelog
Closes #710 Closes #711 Prompt: commit and push
1 parent e31420a commit 982ef8f

3 files changed

Lines changed: 27 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Please ADD ALL Changes to the UNRELEASED SECTION and not a specific release
1111
- fetch: added --switch-to-main flag to switch to the default branch and rebase it when not on it, skipping if there are uncommitted changes
1212
- git/ignore-changelog: script to add CHANGELOG.md to .markdownlintignore across git repositories
1313
- git/reset-all: script to run git reset --hard HEAD across all git repositories
14+
- git/push-all: script to push all git repositories
1415
### Fixed
1516
- Shell scripts were cleaned up to pass pre-commit checks, and git/fetch now uses consistent info/success output.
1617
- Replace raw echo output with standard die/success/info helpers in network/wg-create
@@ -44,6 +45,7 @@ Please ADD ALL Changes to the UNRELEASED SECTION and not a specific release
4445
- git/fetch: Unset core.hookspath for each repo during fetch so that globally-configured hook paths do not persist on individual repos
4546
- check: use mapfile array for file collection to handle filenames containing spaces correctly
4647
- check: guard against empty file list before checking — prevents false-positive success when no scripts are found
48+
- git/ignore-changelog: skip push hooks when pushing to target repositories
4749
### Changed
4850
- Replace raw echo with standard output helpers (die/info/success) in github/cancel-workflows
4951
- Replace raw echo with standard output helpers (die/info/success) in git/update-repos-personal

git/ignore-changelog

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ for dir in "$(pwd)"/*/; do
6262

6363
git -C "$dir" add "$IGNORE_FILE" || { warn "git add failed in $dir"; continue; }
6464
git -C "$dir" commit -m "$COMMIT_MSG" -n || { warn "git commit failed in $dir"; continue; }
65-
if git -C "$dir" push; then
65+
if git -C "$dir" push --no-verify; then
6666
success "Pushed $dir"
6767
else
6868
warn "git push failed in $dir (committed locally)"

git/push-all

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#! /bin/sh
2+
3+
die() {
4+
printf '\n\033[31m✗\033[0m %s\n' "$*" >&2
5+
exit 1
6+
}
7+
8+
success() {
9+
printf '\n\033[32m✓\033[0m %s\n' "$*"
10+
}
11+
12+
info() {
13+
printf '\n\033[32m→\033[0m %s\n' "$*"
14+
}
15+
16+
find "$(pwd)"/* -name '*.git' -print | sed "s|/.git$||" | sort -u | grep -v .cache | while IFS= read -r line
17+
do
18+
info "$line"
19+
CURRENT_DIR=$line
20+
21+
git -C "$CURRENT_DIR" push --no-verify 2>&1
22+
23+
success "Done."
24+
done

0 commit comments

Comments
 (0)