aboutsummaryrefslogtreecommitdiff
path: root/tools/sfsnapshotgit
diff options
context:
space:
mode:
authorGravatar dermoth <dermoth@nagiosplugins.org> 2009-11-11 10:23:57 +0000
committerGravatar dermoth <dermoth@nagiosplugins.org> 2009-11-11 10:34:22 +0000
commitbb193973a8767547edc8626df6cea7d154812de5 (patch)
tree153a37369b22069a3b82289e1ebec7ef225ba854 /tools/sfsnapshotgit
parent2b442ff177751c5ea17e792c10e6d50d7b922b08 (diff)
downloadmonitoring-plugins-bb193973a8767547edc8626df6cea7d154812de5.tar.gz
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
Diffstat (limited to 'tools/sfsnapshotgit')
-rwxr-xr-xtools/sfsnapshotgit5
1 files changed, 3 insertions, 2 deletions
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"