builder: Ensure committer is set when running git-commit#183
builder: Ensure committer is set when running git-commit#183
Conversation
2621f4d to
264e8c8
Compare
|
Fully tested, but uglier than expected. |
src/builder-source-archive.c
Outdated
| email = trim_linefeed (email); | ||
| g_setenv ("GIT_AUTHOR_EMAIL", email, FALSE); | ||
| g_setenv ("GIT_COMMITTER_EMAIL", email, FALSE); | ||
| g_free (email); |
There was a problem hiding this comment.
Overriding the environment globally like this feels a bit weird, as it will affect all processes that f-b later spawns.
Either we should pass the env vars specifically only to the child, or we should do this entire dance up-front in main() so that it affect all git calls.
|
I think just forcing GIT_AUTHOR_EMAIL and GIT_COMMITTER_EMAIL to be set in main() is the right approach. Then we're guaranteeing this to work for all git invocations, and we make the result more reproducible than sometimes using the real authors name. No created commits from flatpak-builder are persistent, except possibly flatpak-builder --run, so we should not set it there. |
If I do that, we don't have a |
264e8c8 to
fd5da4d
Compare
|
Yeah, that doesn't seem as important. |
Otherwise buildbots, and other non-interactive/clean-room builds might not have git committer information set, and make it impossible to successfully commit, and git erroring out with: *** Please tell me who you are.
fd5da4d to
67b5619
Compare
|
📌 Commit 67b5619 has been approved by |
|
⚡ Test exempted: pull fully rebased and already tested. |
Otherwise buildbots, and other non-interactive/clean-room builds might
not have git committer information set, and make it impossible to
successfully commit, and git erroring out with:
*** Please tell me who you are.
This should fix flathub/flathub#443 (comment)