I have this situation at hand:
simple_git_push(){
export cm_args="${@}"
(
set -eo pipefail;
commit_msg="$(echo "$cm_args" | tr -d '[:space:]')" # trim whitespace
if [[ -z "$commit_msg" ]]; then
commit_msg='squash-me'
fi
git commit -am "$commit_msg" # ...
)
}
the problem is the git commit message is always the first token, for example if I do this:
simple_git_push foo bar baz
the commit message will be "foo", but I want the commit message to be 'foo bar baz', how can I do this? Bonus points for escaping characters that git wont like in commit messages..
foobarbaz(no spaces,trremoves them). Are you sure this is exactly the code that is executed?