Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 33 lines (26 sloc) 623 Bytes
#!/bin/sh
.git/hooks/ctags >/dev/null 2>&1 &
tag_file() {
if [ ! -d "$HOME/.mapgit" ]; then
mkdir $HOME/.mapgit
chmod "${MAPGIT_PERMISSIONS:-700}" $HOME/.mapgit
fi
echo "$HOME/.mapgit/geotags"
}
should_geotag_commits() {
[ -f ".git/geotag_commits" ] || git config --get geotag.enabled >/dev/null
}
can_geotag_commits() {
which whereami >/dev/null
}
get_location() {
whereami
}
write_tag() {
echo "$1 $2" >> $(tag_file)
}
if should_geotag_commits && can_geotag_commits; then
echo "Tagging commit.."
rev=`git rev-parse HEAD`
write_tag "$rev" "$(get_location)"
fi