From: Peter Maydell Date: Fri, 16 Jan 2026 12:40:04 +0000 (+0000) Subject: scripts/clean-includes: Give the args in git commit messages X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=84ba328353ba925a704308c2b64ed0defce344ee;p=thirdparty%2Fqemu.git scripts/clean-includes: Give the args in git commit messages If clean-includes is creating a git commit for its changes, currently it says only "created with scripts/clean-includes". Add the command line arguments the user passed us, as useful extra information. Signed-off-by: Peter Maydell Reviewed-by: Markus Armbruster Message-id: 20260116124005.925382-6-peter.maydell@linaro.org --- diff --git a/scripts/clean-includes b/scripts/clean-includes index a45421d2ff..064e532037 100755 --- a/scripts/clean-includes +++ b/scripts/clean-includes @@ -42,6 +42,26 @@ GIT=no DUPHEAD=no +# Save the original arguments in case we want to put them in +# a git commit message, quoted for the shell so that we handle +# args with spaces/metacharacters correctly. +# The quote_sh() function is the same one we use in configure. + +quote_sh() { + printf "%s" "$1" | sed "s,','\\\\'',g; s,.*,'&'," +} + +quote_args() { + while [ $# -gt 0 ]; do + printf "%s" "$(quote_sh "$1")" + shift + if [ $# -gt 0 ]; then + printf " " + fi + done +} + +QUOTEDARGS="$(quote_args "$@")" while true do @@ -198,7 +218,8 @@ if [ "$GIT" = "yes" ]; then git commit --signoff -F - <