From b1ebce16d057b73027b864de52a652c77ee76b46 Mon Sep 17 00:00:00 2001 From: olpc user Date: Fri, 10 Jan 2020 09:10:16 -0800 Subject: small dog organization --- git-maintenance/dog.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/git-maintenance/dog.sh b/git-maintenance/dog.sh index 757fcc4..7c806b0 100755 --- a/git-maintenance/dog.sh +++ b/git-maintenance/dog.sh @@ -31,6 +31,10 @@ echo "" echo "This script is expected to be kept in sync with:" echo " ${URLPFX}/dog.sh" echo "" +echo "Repository will be broken until download completes, as a quick way to ensure data" +echo "is still all accessible by redownloading all of it." +echo "Backup is in .git/bak, must be restored manually." +echo "" # 2. mkdir -p .git/encrypted and git init mkdir -p "$REPONAME" @@ -39,12 +43,13 @@ if ! [ -d ".git" ]; then git init; fi git config gc.auto 0 +chown -R "$USER":"$USER" .git pushd .git # prevent recreation of existing data mkdir -p encrypted mkdir -p bak -cp -va HEAD refs objects/pack bak -rm objects/pack/* +cp --force -a HEAD refs objects/pack bak +rm --force objects/pack/* # 3. download .git/encrypted with wget curl -sfI "$URLPFX"/refs.aes?"$NONCE">/dev/null && wget "$URLPFX"/refs.aes?"$NONCE" -O encrypted/refs.aes || echo "==== BROKEN REMOTE refs.aes PLEASE RE-STORE OR RECOVER ====" @@ -61,6 +66,8 @@ do openssl aes-256-cbc -salt -pbkdf2 -pass "$PASS" -d -in encrypted/"$encpack" | tar -Jxvf - done +chown -R "$USER:$USER" . + for pack in objects/pack/*.pack do git index-pack "$pack" -- cgit v1.2.3