summaryrefslogtreecommitdiffstats
path: root/tools/sfsnapshotgit
diff options
context:
space:
mode:
authordermoth <dermoth@nagiosplugins.org>2009-11-11 10:23:57 (GMT)
committerdermoth <dermoth@nagiosplugins.org>2009-11-11 10:34:22 (GMT)
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 155259f..af05c24 100755
--- a/tools/sfsnapshotgit
+++ b/tools/sfsnapshotgit
@@ -9,7 +9,7 @@
9 9
10# Handle command errors (-e) and coder sleep deprivation issues (-u) 10# Handle command errors (-e) and coder sleep deprivation issues (-u)
11set -eu 11set -eu
12trap 'echo "An error occurred at line $LINENO"; exit 1' EXIT 12trap 'echo "An error occurred in sfsnapshotgit at line $LINENO"; exit 1' EXIT
13 13
14# Send all command output to STDERR while allowing us to write to STDOUT 14# Send all command output to STDERR while allowing us to write to STDOUT
15# using fd 3 15# using fd 3
@@ -46,7 +46,8 @@ git reset --hard
46git clean -qfdx 46git clean -qfdx
47# Any branch used to create snapshots must already exist 47# Any branch used to create snapshots must already exist
48git checkout "$HEAD" 48git checkout "$HEAD"
49git pull "$SFSNAP_ORIGIN" "$HEAD" 49git fetch "$SFSNAP_ORIGIN" "$HEAD"
50git reset --hard "$SFSNAP_ORIGIN"/"$HEAD"
50# Tags are important for git-describe 51# Tags are important for git-describe
51git fetch --tags "$SFSNAP_ORIGIN" 52git fetch --tags "$SFSNAP_ORIGIN"
52 53