[packages/rpm-build-tools/purge] purge_packages: Add option to switch on/off git gc

draenog draenog at pld-linux.org
Sun Mar 24 23:59:07 CET 2013


commit 8bb800a97ebf55ae015cc2ab8bd0044617ad4418
Author: Kacper Kornet <draenog at pld-linux.org>
Date:   Sun Mar 24 21:29:01 2013 +0000

    purge_packages: Add option to switch on/off git gc

 purge-packages.sh | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/purge-packages.sh b/purge-packages.sh
index 45c40ed..4b415c1 100755
--- a/purge-packages.sh
+++ b/purge-packages.sh
@@ -4,6 +4,8 @@
 # - otherwise git gc is called
 set -e
 
+CALL_GC='yes'
+
 topdir=$(rpm -E %_topdir)
 purgedir=$topdir/purged
 cd "$topdir"
@@ -25,11 +27,11 @@ for pkg in */.git; do
 	# FIXME: does not currently handle if some pushes are not made!
 	if [ -n "$status" ] || [ -n "$stash" ]; then
 		cat <<-EOF
-		* Package $pkg - Untracked files or stash not empty. Invoke gc
+		* Package $pkg - Untracked files or stash not empty.
 		$status
 		EOF
 		purge='no'
-		git gc
+		[ "$CALL_GC" = 'yes' ] && git gc
 	fi
 	git show-ref --heads |\
 	{ while read sha1 branch; do
@@ -39,7 +41,7 @@ for pkg in */.git; do
 			purge='no'
 			continue
 		fi
-		if [ -n "$(git rev-list "$branch..$upstream")" ]; then
+		if [ -n "$(git rev-list "$upstream..$branch")" ]; then
 			echo "* Package $pkg - Branch $short_branch is not fully merged to its upstream"
 			purge='no'
 			continue
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/rpm-build-tools.git/commitdiff/8bb800a97ebf55ae015cc2ab8bd0044617ad4418



More information about the pld-cvs-commit mailing list