Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/1] Work around missing git user config in buildhistory
@ 2015-05-21 12:16 Paul Eggleton
  2015-05-21 12:16 ` [PATCH 1/1] classes/buildhistory: ensure that git user email and name are set Paul Eggleton
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Eggleton @ 2015-05-21 12:16 UTC (permalink / raw)
  To: openembedded-core

The following change since commit fe7780a9bbbfa4dcbbe457618a0842e91a3c6a0e:

  libxdmcp: make libbsd usage deterministic (2015-05-21 10:48:41 +0100)

is available in the git repository at:

  git://git.openembedded.org/openembedded-core-contrib paule/buildhistory-gituser
  http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=paule/buildhistory-gituser

Paul Eggleton (1):
  classes/buildhistory: ensure that git user email and name are set

 meta/classes/buildhistory.bbclass | 9 +++++++++
 1 file changed, 9 insertions(+)

-- 
2.1.0



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

* [PATCH 1/1] classes/buildhistory: ensure that git user email and name are set
  2015-05-21 12:16 [PATCH 0/1] Work around missing git user config in buildhistory Paul Eggleton
@ 2015-05-21 12:16 ` Paul Eggleton
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Eggleton @ 2015-05-21 12:16 UTC (permalink / raw)
  To: openembedded-core

The git user.email and user.name settings must be set or the commit to
the buildhistory repo (when BUILDHISTORY_COMMIT is set to "1") will
fail. If the user hasn't set these, set some dummy values since the
actual value is unlikely to be particularly useful and it's far worse
for the commit not to be done leaving the repository in a partially set
up state.

Prompted by [YOCTO #6973].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 meta/classes/buildhistory.bbclass | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index 211dcf1..777aabc 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -581,6 +581,15 @@ END
 			git tag -f build-minus-2 build-minus-1 > /dev/null 2>&1 || true
 			git tag -f build-minus-1 > /dev/null 2>&1 || true
 		fi
+		# If the user hasn't set up their name/email, set some defaults
+		# just for this repo (otherwise the commit will fail with older
+		# versions of git)
+		if ! git config user.email > /dev/null ; then
+			git config --local user.email "buildhistory@${DISTRO}"
+		fi
+		if ! git config user.name > /dev/null ; then
+			git config --local user.name "buildhistory"
+		fi
 		# Check if there are new/changed files to commit (other than metadata-revs)
 		repostatus=`git status --porcelain | grep -v " metadata-revs$"`
 		HOSTNAME=`hostname 2>/dev/null || echo unknown`
-- 
2.1.0



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

end of thread, other threads:[~2015-05-21 12:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-21 12:16 [PATCH 0/1] Work around missing git user config in buildhistory Paul Eggleton
2015-05-21 12:16 ` [PATCH 1/1] classes/buildhistory: ensure that git user email and name are set Paul Eggleton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox