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

* Re: [PATCH] buildhistory: set commit user name and email for the new git repo
  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
  0 siblings, 1 reply; 4+ messages in thread
From: Mikko.Rapeli @ 2015-05-26 14:58 UTC (permalink / raw)
  To: openembedded-core

Already fixed by merged commit:

http://git.openembedded.org/openembedded-core/commit/?id=f62255bfa6c5a322c867b7c4ea5686ea7bfab3fe

-Mikko

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

* Re: [PATCH] buildhistory: set commit user name and email for the new git repo
  2015-05-26 14:58 ` Mikko.Rapeli
@ 2015-05-26 17:39   ` Paul Eggleton
  2015-05-27  6:52     ` Mikko.Rapeli
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Eggleton @ 2015-05-26 17:39 UTC (permalink / raw)
  To: Mikko.Rapeli; +Cc: openembedded-core

Hi Mikko,

On Tuesday 26 May 2015 14:58:02 Mikko.Rapeli@bmw.de wrote:
> Already fixed by merged commit:
> 
> http://git.openembedded.org/openembedded-core/commit/?id=f62255bfa6c5a322c86
> 7b7c4ea5686ea7bfab3fe
> 
> -Mikko

My apologies for basically duplicating your patch - by coincidence I was 
talking to our QA team about resolving what turned out to be the same issue at 
around the same time.

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre


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

* Re: [PATCH] buildhistory: set commit user name and email for the new git repo
  2015-05-26 17:39   ` Paul Eggleton
@ 2015-05-27  6:52     ` Mikko.Rapeli
  0 siblings, 0 replies; 4+ messages in thread
From: Mikko.Rapeli @ 2015-05-27  6:52 UTC (permalink / raw)
  To: paul.eggleton; +Cc: openembedded-core

On Tue, May 26, 2015 at 06:39:18PM +0100, Paul Eggleton wrote:
> Hi Mikko,
> 
> On Tuesday 26 May 2015 14:58:02 Mikko.Rapeli@bmw.de wrote:
> > Already fixed by merged commit:
> > 
> > http://git.openembedded.org/openembedded-core/commit/?id=f62255bfa6c5a322c86
> > 7b7c4ea5686ea7bfab3fe
> > 
> > -Mikko
> 
> My apologies for basically duplicating your patch - by coincidence I was 
> talking to our QA team about resolving what turned out to be the same issue at 
> around the same time.

No problem. In my patch I set the git user.name and user.email every time
to allow changing settings in local.conf without rebuilding from scratch
but if that really becomes a problem then I'll send a new patch.

-Mikko

^ permalink raw reply	[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.