All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] buildhistory: set commit user name and email for the new git repo
@ 2015-05-20  6:45 Mikko Rapeli
  2015-05-26 14:58 ` Mikko.Rapeli
  0 siblings, 1 reply; 4+ messages in thread
From: Mikko Rapeli @ 2015-05-20  6:45 UTC (permalink / raw)
  To: openembedded-core

git commit needs a user name and email even if --author is set. In most
cases users have ~/.gitconfig but in some cases the build user account
does not have these set which breaks the build.

Change-Id: Idd35df626332756ba5bd61d9273c76c7e63ed3f9
Signed-off-by: Mikko Rapeli <mikko.rapeli@bmw.de>
---
 meta/classes/buildhistory.bbclass | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index 211dcf1..dbd27b0 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -14,7 +14,9 @@ BUILDHISTORY_DIR_PACKAGE = "${BUILDHISTORY_DIR}/packages/${MULTIMACH_TARGET_SYS}
 BUILDHISTORY_DIR_SDK = "${BUILDHISTORY_DIR}/sdk/${SDK_NAME}/${IMAGE_BASENAME}"
 BUILDHISTORY_IMAGE_FILES ?= "/etc/passwd /etc/group"
 BUILDHISTORY_COMMIT ?= "0"
-BUILDHISTORY_COMMIT_AUTHOR ?= "buildhistory <buildhistory@${DISTRO}>"
+BUILDHISTORY_COMMIT_USER_NAME ?= "buildhistory"
+BUILDHISTORY_COMMIT_USER_EMAIL ?= "<buildhistory@${DISTRO}>"
+BUILDHISTORY_COMMIT_AUTHOR ?= "${BUILDHISTORY_COMMIT_USER_NAME} ${BUILDHISTORY_COMMIT_USER_EMAIL}"
 BUILDHISTORY_PUSH_REPO ?= ""
 
 SSTATEPOSTINSTFUNCS_append = " buildhistory_emit_pkghistory"
@@ -586,6 +588,11 @@ END
 		HOSTNAME=`hostname 2>/dev/null || echo unknown`
 		CMDLINE="${@buildhistory_get_cmdline(d)}"
 		if [ "$repostatus" != "" ] ; then
+			# git commit needs this setup, done every time before
+			# commit to support name and email changes via
+			# bitbake configuration
+			git config user.name "${BUILDHISTORY_COMMIT_USER_NAME}"
+			git config user.email "${BUILDHISTORY_COMMIT_USER_EMAIL}"
 			git add -A .
 			# porcelain output looks like "?? packages/foo/bar"
 			# Ensure we commit metadata-revs with the first commit
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-05-27  7:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-20  6:45 [PATCH] buildhistory: set commit user name and email for the new git repo Mikko Rapeli
2015-05-26 14:58 ` Mikko.Rapeli
2015-05-26 17:39   ` Paul Eggleton
2015-05-27  6:52     ` Mikko.Rapeli

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.