From 9a56247c518b47d425788c8dc9ffce6c4b06e186 Mon Sep 17 00:00:00 2001 From: hololeap Date: Mon, 6 Mar 2023 09:46:28 -0700 Subject: [PATCH] commit-changed-pkgs: Take message as argument Instead of keeping the message in a file, take the message as an argument. Automatically prepends '*: ' to the message. --- git/commit-changed-pkgs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/git/commit-changed-pkgs b/git/commit-changed-pkgs index 386b9ab..fd26d75 100755 --- a/git/commit-changed-pkgs +++ b/git/commit-changed-pkgs @@ -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} " + exit 1 +fi + # # Get a list of the files changed @@ -52,7 +57,7 @@ for dir in ${dirs[@]} ; do cd "${dir}" git add . - pkgdev commit -M ${template} + pkgdev commit -M <(echo "*: ${message}") cd ../.. done