mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] patchin: Don't trigger git garbage collection
@ 2019-04-04 19:18 Uwe Kleine-König
  2019-04-05 12:06 ` Uwe Kleine-König
  0 siblings, 1 reply; 2+ messages in thread
From: Uwe Kleine-König @ 2019-04-04 19:18 UTC (permalink / raw)
  To: ptxdist

When extracting the sources for a big package (e.g. kernel) git forks a
process to repack the repository "for optimum performance" (unless
configured otherwise for example in ~/.gitconfig). However this is time
that is not well spend when waiting for a build to complete.

So ensure that ptxdist doesn't trigger this housekeeping. As this
cleanup is sensible as soon as you start modifying the git repository,
suppress it only via the commandline instead of modifying the
repository's configuration.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 scripts/lib/ptxd_make_world_patchin.sh | 35 +++++++++++++++++---------
 1 file changed, 23 insertions(+), 12 deletions(-)

diff --git a/scripts/lib/ptxd_make_world_patchin.sh b/scripts/lib/ptxd_make_world_patchin.sh
index 606d9ebc028b..021989e27e06 100644
--- a/scripts/lib/ptxd_make_world_patchin.sh
+++ b/scripts/lib/ptxd_make_world_patchin.sh
@@ -45,6 +45,17 @@ ptxd_make_world_patchin_apply_init()
 export -f ptxd_make_world_patchin_apply_init
 
 
+#
+# Wrapper that prevents running automatic repack during ptxdist runs to not
+# loose more time on patch stacks that maybe are not modified anyhow.
+#
+__git()
+{
+	git -c gc.auto=0 "$@"
+}
+export -f __git
+
+
 #
 # initialize git database in $pkg_patchin_dir and do initial commit
 #
@@ -56,14 +67,14 @@ ptxd_make_world_patchin_apply_git_init()
     # is already git repo?
     if [ "${git_dir}" != ".git" ]; then
 	echo "patchin: git: initializing repository"
-	git init -q &&
-	git add -f . &&
-	git commit -q -m "initial commit" --author="ptxdist-${PTXDIST_VERSION_FULL} <ptxdist@pengutronix.de>" &&
-	git tag "${pkg_pkg//\~/-}" &&
-	git tag base &&
-	git config alias.ptx-patches "!${PTXDIST_TOPDIR}/scripts/git-ptx-patches \"\${@}\"" &&
-	git config diff.renames false &&
-	git config core.abbrev 12 &&
+	__git init -q &&
+	__git add -f . &&
+	__git commit -q -m "initial commit" --author="ptxdist-${PTXDIST_VERSION_FULL} <ptxdist@pengutronix.de>" &&
+	__git tag "${pkg_pkg//\~/-}" &&
+	__git tag base &&
+	__git config alias.ptx-patches "!${PTXDIST_TOPDIR}/scripts/git-ptx-patches \"\${@}\"" &&
+	__git config diff.renames false &&
+	__git config core.abbrev 12 &&
 	echo "patchin: git: done"
     fi
 }
@@ -139,24 +150,24 @@ ptxd_make_world_patchin_apply_git()
 	    mv ${pkg_patchin_dir}/.ptxdist/git-patches/series{,.1} || return
 	    mv ${pkg_patchin_dir}/.ptxdist/git-patches/series{.${tag},} || return
 
-	    git quiltimport \
+	    __git quiltimport \
 		--patches "${pkg_patchin_dir}/.ptxdist/git-patches" \
 		--author "unknown author <unknown.author@example.com>" &&
 	    echo "tagging -> ${tag}" &&
-	    git tag -f ${tag} &&
+	    __git tag -f ${tag} &&
 	    mv ${pkg_patchin_dir}/.ptxdist/git-patches/series{,.${tag}} || return
 	    mv ${pkg_patchin_dir}/.ptxdist/git-patches/series{.1,} || return
 	fi
     done
 
-    git quiltimport \
+    __git quiltimport \
 	--patches "${pkg_patchin_dir}/.ptxdist/git-patches" \
 	--author "unknown author <unknown.author@example.com>" &&
 
     # skip patches generated by other tools with '# <tool>-end' as end marker
     if tail -n1 "${pkg_patchin_dir}/.ptxdist/series" | grep -q '# [^ ]*-end$'; then
 	local last="$(sed -n 's/^0*\([1-9][0-9]*\)-.*/\1/p' "${pkg_patchin_dir}/.ptxdist/series" | tail -n1)"
-	git tag -f base || return
+	__git tag -f base || return
 	local next=1000
 	if [ -n "${last}" ]; then
 		next="$[(1+${last}/1000)*1000]"
-- 
2.20.1


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

end of thread, other threads:[~2019-04-05 12:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-04 19:18 [ptxdist] [PATCH] patchin: Don't trigger git garbage collection Uwe Kleine-König
2019-04-05 12:06 ` Uwe Kleine-König

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