From patchwork Tue Mar 20 13:38:52 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [RFC,v2,1/3] buildhistory: record all builds Date: Tue, 20 Mar 2012 13:38:52 -0000 From: Koen Kooi X-Patchwork-Id: 23859 Message-Id: <1332250734-14660-1-git-send-email-koen@dominion.thruhere.net> To: openembedded-core@lists.openembedded.org Cc: Koen Kooi Allow empty commits, this also give a nice speedup since 'git status --porcelain' doesn't need to get run. Signed-off-by: Koen Kooi Acked-by: Paul Eggleton --- meta/classes/buildhistory.bbclass | 17 +++++++---------- 1 files changed, 7 insertions(+), 10 deletions(-) diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass index f99aa7f..1926d12 100644 --- a/meta/classes/buildhistory.bbclass +++ b/meta/classes/buildhistory.bbclass @@ -396,16 +396,13 @@ buildhistory_commit() { if [ ! -d .git ] ; then git init -q fi - # Ensure there are new/changed files to commit - repostatus=`git status --porcelain` - if [ "$repostatus" != "" ] ; then - git add ${BUILDHISTORY_DIR}/* - HOSTNAME=`hostname 2>/dev/null || echo unknown` - git commit ${BUILDHISTORY_DIR}/ -m "Build ${BUILDNAME} of ${DISTRO} ${DISTRO_VERSION} for machine ${MACHINE} on $HOSTNAME" --author "${BUILDHISTORY_COMMIT_AUTHOR}" > /dev/null - if [ "${BUILDHISTORY_PUSH_REPO}" != "" ] ; then - git push -q ${BUILDHISTORY_PUSH_REPO} - fi - fi) || true + git add ${BUILDHISTORY_DIR}/* + HOSTNAME=`hostname 2>/dev/null || echo unknown` + git commit ${BUILDHISTORY_DIR}/ --allow-empty -m "Build ${BUILDNAME} of ${DISTRO} ${DISTRO_VERSION} for machine ${MACHINE} on $HOSTNAME" --author "${BUILDHISTORY_COMMIT_AUTHOR}" > /dev/null + if [ "${BUILDHISTORY_PUSH_REPO}" != "" ] ; then + git push -q ${BUILDHISTORY_PUSH_REPO} + fi + ) || true } python buildhistory_eventhandler() {