Using python subprocess to commit changes to a git branch, the -m message will only accept single string
I am using python 3 to loop through a directory to commit changes for all xml files. I have tried using double quotes and single quotes for the message, neither have worked. I also tried using f and r and both failed.
add=subprocess.Popen([gitPath,'git add .'],cwd=cd,shell=True,stdout=subprocess.PIPE)
subprocess.Popen.wait(add)
commit=subprocess.Popen([gitPath,f"git commit -m 'no message spacing works'"],cwd=cd,shell=True,stdout=subprocess.PIPE)
subprocess.Popen.wait(commit)
push=subprocess.Popen([gitPath,'git push origin DEV:PyTesting'],cwd=cd,shell=True,stdout=subprocess.PIPE)
subprocess.Popen.wait(push)
I would like to be able to use regular text strings, including spaces, to put in the input commit message. When I use "no message spacing works" in the script the errors are error: pathspec 'message' did not match any file(s) known to git error: pathspec 'spacing' did not match any file(s) known to git error: pathspec 'works'' did not match any file(s) known to git
If I use git commit -m 'no message spacing works' in bash, it is accepted. What am I missing in the script to allow multiple strings?