mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: ptxdist@pengutronix.de
Subject: [ptxdist] [PATCH] patchin: Don't trigger git garbage collection
Date: Thu,  4 Apr 2019 21:18:09 +0200	[thread overview]
Message-ID: <20190404191809.19574-1-u.kleine-koenig@pengutronix.de> (raw)

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

             reply	other threads:[~2019-04-04 19:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-04 19:18 Uwe Kleine-König [this message]
2019-04-05 12:06 ` Uwe Kleine-König

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190404191809.19574-1-u.kleine-koenig@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox