Skip to content
This repository has been archived by the owner on Dec 14, 2023. It is now read-only.

Commit

Permalink
Speed up conversion by re-using old pack files
Browse files Browse the repository at this point in the history
As we're pushing upstream (which I think will result in a bunch of loose
objects for our incremental pushes) stop wasting time on finding the
best compression and simply re-use the pack files from the previous run.
This also means the conversion won't have write out packfiles, as little
changes.
  • Loading branch information
uqs committed Nov 26, 2020
1 parent 2c05b64 commit 194549a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
12 changes: 9 additions & 3 deletions git_conv
Expand Up @@ -281,9 +281,15 @@ svn2git()
(
cd $target
echo "Compacting, showing before and after numbers:"
# Takes much longer, but compresses better:
#du -sh .; git gc --aggressive --prune=now --force; du -sh .
du -sh .; git repack -adf; du -sh .
du -sh .
if [ `du -sg . | awk '{print $1}'` -ge 2 ]; then
# Takes much longer, but compresses better:
#du -sh .; git gc --aggressive --prune=now --force; du -sh .
git repack -adf
else
git repack
fi
du -sh .
git log --reverse --date=short --pretty="format:%ai %an %d %T %N%B" > ../$TYPE-gitlog
)
fi
Expand Down
10 changes: 7 additions & 3 deletions git_conv_cron
Expand Up @@ -16,15 +16,18 @@ LOG="$PWD/`date +%Y-%m-%d`_${TYPE}.log"

case "$1" in
base)
rm -rf freebsd-$1.git/ gitlog-freebsd-$1.git log-freebsd-$1.git log-freebsd-$1.git.old log-$1
find freebsd-$1.git -not -path "*/objects*" -type f -delete || true
rm -rf gitlog-freebsd-$1.git log-freebsd-$1.git log-freebsd-$1.git.old log-$1
rm -rf mi
rm -rf archive/*/wrk 2>/dev/null
./git_conv "$@" >> $LOG 2>&1
./tag_archived_src.sh >> $LOG 2>&1
./fix_bogus_tags.sh >> $LOG 2>&1
(cd freebsd-$1.git && git repack)
;;
ports|doc)
rm -rf freebsd-$1.git/ gitlog-freebsd-$1.git log-freebsd-$1.git log-freebsd-$1.git.old log-$1
find freebsd-$1.git -not -path "*/objects*" -type f -delete || true
rm -rf gitlog-freebsd-$1.git log-freebsd-$1.git log-freebsd-$1.git.old log-$1
./git_conv "$@" >> $LOG 2>&1
;;
*)
Expand All @@ -38,6 +41,7 @@ if [ $? != 0 ]; then
tail -30 $LOG
exit 1
else
cd freebsd-$1.git && git push -q freebsd
# guard against me messing this up ...
test `whoami` = git && cd freebsd-$1.git && git push -q freebsd
#&& cd $HOME/repositories/$REPO.git && git gc --aggressive --prune=now --force --quiet
fi

0 comments on commit 194549a

Please sign in to comment.