Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

commit-changed-pkgs: Take message as argument #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions git/commit-changed-pkgs
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
#!/usr/bin/env bash
# commit-changed-pkgs

# Commits all changes with a given template
# Commits all changes with a given message
# Can exclude by maintainer.
# Useful for e.g. big batch changes like a sed across tree

# Usage:
# bash ~/scripts/commit-changed-pkgs
# bash ~/scripts/commit-changed-pkgs "message"

# Configuration:
# - maintainers: maintainers to skip
# - template: file containing "*: msg" for pkgdev
# - debug: noisy or not
#maintainers="(some-project-to-treat-specially)"
maintainers=""
template="${BASH_SOURCE%/*}/template-pkgdev"
debug=1

if [[ -n "$1" ]]; then
message="$1"
else
echo "Usage: bash ${0} <MESSAGE>"
exit 1
fi

#

# Get a list of the files changed
Expand Down Expand Up @@ -52,7 +57,7 @@ for dir in ${dirs[@]} ; do
cd "${dir}"

git add .
pkgdev commit -M ${template}
pkgdev commit -M <(echo "*: ${message}")

cd ../..
done