I am misusing git as a store-and-forward tool to transfer reports to a
server in a resilient manner.
The context is puppet (and ppg, I've spammed the list about it... ).
The reports are small, with small deltas, but created frequently.
With the exaction of the final destination, I want to expire reports
that are old and successfully transferred.
My current approach is (bash-y pseudocode):
git push bla bla || exit $?
prunehash=$(git log -n1 --until=one.month.ago --pretty=format:%H)
test -z "$prunehash" && exit 0
# prep empty commit
# skip git read-tree --empty, we get the same with
export GIT_INDEX_FILE=/does/not/exist
empty_tree="$(git write-tree)"
unset GIT_INDEX_FILE
empty_commit="$(git commit-tree -m empty "$empty_tree")"
echo "${prunehash} ${empty_commit}" >> .git/info/grafts
git gc
# TODO: cleanup stale grafts :-)
is this a reasonable approach?
m
--
[email protected]
- ask interesting questions
- don't get distracted with shiny stuff - working code first
~ http://docs.moodle.org/en/User:Martin_Langhoff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html