summaryrefslogtreecommitdiffstats
path: root/scripts/lib/ptxd_make_world_patchin.sh
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2019-04-04 21:18:09 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2019-04-08 08:20:06 +0200
commitf9568e2a1d9857fa44aabef0fdf0ebead8b3043b (patch)
tree2c467855f34b204bb53d90b349f2393e6d005206 /scripts/lib/ptxd_make_world_patchin.sh
parentb72e86f7fd07fb2124d60ce68710e64b953a4539 (diff)
downloadptxdist-f9568e2a1d9857fa44aabef0fdf0ebead8b3043b.tar.gz
ptxdist-f9568e2a1d9857fa44aabef0fdf0ebead8b3043b.tar.xz
patchin: Don't trigger git garbage collection
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. Reported-by: Tim Knecht <T.Knecht@eckelmann.de> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'scripts/lib/ptxd_make_world_patchin.sh')
-rw-r--r--scripts/lib/ptxd_make_world_patchin.sh37
1 files changed, 24 insertions, 13 deletions
diff --git a/scripts/lib/ptxd_make_world_patchin.sh b/scripts/lib/ptxd_make_world_patchin.sh
index 36dcf2ae1..3f79f41c5 100644
--- a/scripts/lib/ptxd_make_world_patchin.sh
+++ b/scripts/lib/ptxd_make_world_patchin.sh
@@ -46,6 +46,17 @@ 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
#
ptxd_make_world_patchin_apply_git_init()
@@ -56,15 +67,15 @@ 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 config core.autocrlf false &&
+ __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 config core.autocrlf false &&
echo "patchin: git: done"
fi
}
@@ -140,24 +151,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]"