Patchwork [8/8] classes/buildhistory: do git garbage collection after committing

login
register
mail settings
Submitter Paul Eggleton
Date Dec. 2, 2013, 6:50 p.m.
Message ID <34cc88411cf0ee72557230d1009f9cbd8d010069.1386009885.git.paul.eggleton@linux.intel.com>
Download mbox | patch
Permalink /patch/62693/
State New
Headers show

Comments

Paul Eggleton - Dec. 2, 2013, 6:50 p.m.
We don't normally perform any operations (such as "git pull") that
trigger "git gc --auto", thus garbage collection never happens which
means performance of accessing the repository degrades noticeably over
time. Add an explicit "git gc --auto" to clean things up when needed.

Thanks to Elijah Newren and Ross Burton for suggesting this.

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

Patch

diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index e46b124..d25496d 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -533,6 +533,7 @@  END
 			for entry in `echo "$repostatus" | awk '{print $2}' | awk -F/ '{print $1}' | sort | uniq` ; do
 				git commit $entry metadata-revs -m "$entry: Build ${BUILDNAME} of ${DISTRO} ${DISTRO_VERSION} for machine ${MACHINE} on $HOSTNAME" -m "cmd: $CMDLINE" --author "${BUILDHISTORY_COMMIT_AUTHOR}" > /dev/null
 			done
+			git gc --auto
 			if [ "${BUILDHISTORY_PUSH_REPO}" != "" ] ; then
 				git push -q ${BUILDHISTORY_PUSH_REPO}
 			fi