diff --git a/.git_helpers/ctags b/bin/git-ctags copy from .git_helpers/ctags copy to bin/git-ctags --- a/.git_helpers/ctags +++ b/bin/git-ctags @@ -1,34 +1,44 @@ #!/usr/bin/env ruby # Meant for use as a git hook: -# CTAGS_HOOK=1 .git/hooks/ctags &>/dev/null /dev/null 60 + exit unless f.flock(File::LOCK_EX|File::LOCK_NB) + exit unless (Time.now - f.mtime) > 60 end - system( <<-CMD ) or exit $?.exitstatus + system(<<-CMD) or exit $?.exitstatus git ls-files \ | #{ctags} --tag-relative -L - -f"#{tmp}" #{opts} \ && mv #{tmp} #{target}