diff options
| author | dermoth <dermoth@nagiosplugins.org> | 2009-11-11 10:23:57 +0000 |
|---|---|---|
| committer | dermoth <dermoth@nagiosplugins.org> | 2009-11-11 10:34:22 +0000 |
| commit | bb193973a8767547edc8626df6cea7d154812de5 (patch) | |
| tree | 153a37369b22069a3b82289e1ebec7ef225ba854 /tools/sfsnapshotgit | |
| parent | 2b442ff177751c5ea17e792c10e6d50d7b922b08 (diff) | |
| download | monitoring-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-x | tools/sfsnapshotgit | 5 |
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 @@ | |||
| 9 | 9 | ||
| 10 | # Handle command errors (-e) and coder sleep deprivation issues (-u) | 10 | # Handle command errors (-e) and coder sleep deprivation issues (-u) |
| 11 | set -eu | 11 | set -eu |
| 12 | trap 'echo "An error occurred at line $LINENO"; exit 1' EXIT | 12 | trap '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 | |||
| 46 | git clean -qfdx | 46 | git clean -qfdx |
| 47 | # Any branch used to create snapshots must already exist | 47 | # Any branch used to create snapshots must already exist |
| 48 | git checkout "$HEAD" | 48 | git checkout "$HEAD" |
| 49 | git pull "$SFSNAP_ORIGIN" "$HEAD" | 49 | git fetch "$SFSNAP_ORIGIN" "$HEAD" |
| 50 | git reset --hard "$SFSNAP_ORIGIN"/"$HEAD" | ||
| 50 | # Tags are important for git-describe | 51 | # Tags are important for git-describe |
| 51 | git fetch --tags "$SFSNAP_ORIGIN" | 52 | git fetch --tags "$SFSNAP_ORIGIN" |
| 52 | 53 | ||
