From bb193973a8767547edc8626df6cea7d154812de5 Mon Sep 17 00:00:00 2001 From: dermoth Date: Wed, 11 Nov 2009 10:23:57 +0000 Subject: Many fixes to snapshot scripts sfsnapshotgit: - Use fetch/reset instead to pull to avoid merges on forced updates sfsnapshot-upload: - Fix link deletion walking the entire home dir - Allow CLEAN_TIME=0 (no retention) - Re-add per-branch links when CLEAN_TIME > 0 - Add many comments --- tools/sfsnapshotgit | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tools/sfsnapshotgit') diff --git a/tools/sfsnapshotgit b/tools/sfsnapshotgit index 155259f0..af05c24b 100755 --- a/tools/sfsnapshotgit +++ b/tools/sfsnapshotgit @@ -9,7 +9,7 @@ # Handle command errors (-e) and coder sleep deprivation issues (-u) set -eu -trap 'echo "An error occurred at line $LINENO"; exit 1' EXIT +trap 'echo "An error occurred in sfsnapshotgit at line $LINENO"; exit 1' EXIT # Send all command output to STDERR while allowing us to write to STDOUT # using fd 3 @@ -46,7 +46,8 @@ git reset --hard git clean -qfdx # Any branch used to create snapshots must already exist git checkout "$HEAD" -git pull "$SFSNAP_ORIGIN" "$HEAD" +git fetch "$SFSNAP_ORIGIN" "$HEAD" +git reset --hard "$SFSNAP_ORIGIN"/"$HEAD" # Tags are important for git-describe git fetch --tags "$SFSNAP_ORIGIN" -- cgit v1.2.3-74-g34f1