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:
PreLoad: Before the DB is loaded, this hook is run. Could be used to synchronize changes with a cloud source, or to create a backup copy of the DB in the event something happens.
PostCommit: Run after information is committed to the DB and written back to the filesystem. The committed record is sent to this hook on stdin.
PreCommit: Run before anything is written to the database. Can be used to check for inconsistencies between this local database, and a remove database.
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:
Synchronizing the record DB between multiple computers or with an authoritative cloud source (like GitHub, or DynamoDB/CosmosDB/CloudSpanner).
Integrating with other time tracking applications or task tracking applications.
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: