[coreboot-gerrit] Change in coreboot[master]: util/genbuild_h: Add gitfile support

Alex Thiessen (Code Review) gerrit at coreboot.org
Sun Jan 14 13:14:25 CET 2018


Alex Thiessen has uploaded this change for review. ( https://review.coreboot.org/23256


Change subject: util/genbuild_h: Add gitfile support
......................................................................

util/genbuild_h: Add gitfile support

`genbuild_h.sh` checks whether it is running from a coreboot's own git
worktree to decide wheter to use git as the time source. This check
fails when `${top}/.git` is a gitfile, e.g. when coreboot is a
submodule.

Add a proper `git rev-parse` call to check the condition.

Change-Id: I8bb13d607a01f4f28fa8b165769e0a1f702da362
Signed-off-by: Alex Thiessen <alex.thiessen+coreboot at gmail.com>
---
M util/genbuild_h/genbuild_h.sh
1 file changed, 3 insertions(+), 1 deletion(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/56/23256/1

diff --git a/util/genbuild_h/genbuild_h.sh b/util/genbuild_h/genbuild_h.sh
index dfbfca5..8f6d0eb 100755
--- a/util/genbuild_h/genbuild_h.sh
+++ b/util/genbuild_h/genbuild_h.sh
@@ -28,7 +28,9 @@
 	GITREV=Timeless
 	TIMESOURCE="fixed"
 	DATE=0
-elif GIT_DIR="${top}/.git" git status > /dev/null 2>&1; then
+elif cdup="$(git -C "${top}" rev-parse --show-cdup 2>/dev/null)" \
+	&& [ -z	"${cdup}" ]
+then
 	GITREV=$(LANG= git log -1 --format=format:%h)
 	TIMESOURCE=git
 	DATE=$(git log --pretty=format:%ct -1)

-- 
To view, visit https://review.coreboot.org/23256
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8bb13d607a01f4f28fa8b165769e0a1f702da362
Gerrit-Change-Number: 23256
Gerrit-PatchSet: 1
Gerrit-Owner: Alex Thiessen <alex.thiessen.de+coreboot at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180114/f7cc15d8/attachment.html>


More information about the coreboot-gerrit mailing list