Are you saying that you can commit, make a small change to some target dependent on versioning, build and reliably get Xcode to preprocess the plist for you?
I have a run script as part of the build phase. The script does:
sed -e "s/#.*#/#`/usr/local/bin/git describe`#/" <Sources/Credits-input.rtf >Credits.rtf
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $(git describe --abbrev=0 | cut -b 2-)" "${TARGET_BUILD_DIR}"/${INFOPLIST_PATH}
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $(git log --pretty=oneline --abbrev-commit -1 | cut -b 1-7)" "${TARGET_BUILD_DIR}"/${INFOPLIST_PATH}
That seems to work. The Info.plist in the generated bundle contains
<key>CFBundleShortVersionString</key>
<string>2.2</string>
...
<key>CFBundleVersion</key>
<string>55d9ec5</string>
Yeah, using a git sha is the wrong thing for CFBundleVersion. This code was written before I knew better and I've been too lazy to change it.