Riebart / litt

Low-intrusion time tracking with minimal workflow footprint, a CLI interface, basic REST API, and a single JSON file DB for painless interop.
Mozilla Public License 2.0
8 stars 1 forks source link

Hooks for commit and other events #1

Open Riebart opened 6 years ago

Riebart commented 6 years ago

Being able to run arbitrary processing on different events in the time tracking flow would be useful. This could be used to synchronize time tracking databases to a cloud source (like GitHub, even), or cloud storage, or could transform the committed time tracking information into ics or other calendar operations to add the events to other time tracking tools. This would enable direct synchronous integration with other time tracking tooling.

Implemention would be folders in ~/.litt/hooks/ that themselves contained arbitrary executable files (shell scripts, Python/Ruby/other scripts, or even compiled binaries). A non-zero exit of these hook executables would halt the processing of the tt logic.

Some hook events I had in mind are:

For example, for the PostoOmmit hook, after changes are flushed to the filesystem, every file matching (non-recursively) the glob ~/.litt/hooks/post_commit/* would be run, and the JSON document describing the record just committed to the DB would be passed in on stdin to the hook executable.

Use cases: