From: Prarit Bhargava <prarit(a)redhat.com>
redhat/kernel.spec.template: Set worktree git user information
Builds fail with:
Committer identity unknown
*** Please tell me who you are.
Run
git config --global user.email "you(a)example.com"
git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
fatal: unable to auto-detect email address (got
'mockbuild(a)a6a1262f1b604ce09d24d04d7a377c59.(none)')
RPM build errors:
error: Bad exit status from /var/tmp/rpm-tmp.BdLSyq (%prep)
Bad exit status from /var/tmp/rpm-tmp.BdLSyq (%prep)
This can be avoided by setting and unsetting git user information in the
patch application section.
Signed-off-by: Prarit Bhargava <prarit(a)redhat.com>
diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template
index blahblah..blahblah 100755
--- a/redhat/kernel.spec.template
+++ b/redhat/kernel.spec.template
@@ -1441,6 +1441,10 @@ git init .
# disable autopacking in repository
git config --worktree gc.autopacklimit 0
git config --worktree gc.auto 0
+# set email and name for initial commits (these are reset at the end of the
+# patch applications)
+git config --worktree user.email "kernel-team(a)fedoraproject.org"
+git config --worktree user.name "Fedora Kernel Team"
git add -A
git commit . -q --author "Fedora Kernel Team
<kernel-team(a)fedoraproject.org>" -m "Base commit for linux
%kabiversion"
@@ -1451,6 +1455,11 @@ ApplyOptionalPatch patch-%{patchversion}-redhat.patch
"Fedora/ARK %patchversion
ApplyOptionalPatch linux-kernel-test.patch "linux-kernel-test changes"
+# These command must be done last in patch applications. If these git
+# configuration variables are left set then future commits to the repository
+# will be attributed incorrectly.
+git config --worktree --unset user.email
+git config --worktree --unset user.name
# END OF PATCH APPLICATIONS
# Any further pre-build tree manipulations happen here.
--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2174