- Prefix git commits with `` to distinguish them from normal commits
- Configuration:
- Add checkpoint every:
- per x words
- per y minutes
- Save last X checkpoints
- Filetypes to check/ignore (have a default list)
- Add checkpoint every:
- Checkpoints will be named with the timestamp
-
autosaved
command (short for autosaved interface):autosaved init
: initialisesautosaved
in a particular directoryautosaved list [X=10]
: list last X autosaves, with numberautosaved restore commit-hash
: restores the Nth checkpoint (with confirmation prompt) or the checkpoint with given timestampautosaved save
: save current state as a checkpointautosaved diff [N]|[Timestamp]
: diffautosaved
checkpoint with current state of the index- [Optional]
autosaved diff [N1|T2]..[N2|T2] -- <paths>
: diff 2 ofautosaved
checkpoints
-
Configuration:
- YAML configuration file
-
after_every: words: 10 minutes: 2
- Use go-git for managing autosaved
- Diff using
go-git
with the latest autosaved commit for getting number of characters changed - Use spf13/cobra for CLI
-
Get
autosaved watch
to work correctly- Create first checkpoint
- Notify Daemon to watch this directory also (or start a background process itself to keep watching it)
-
Implement
autosaved save
, and helpers for it which can be reused in other places (like init)- Should save all files except .git, with the current timestamp
-
Implement
autosaved list
-
Autosave Daemon
-
autosaved start
-
autosaved stop
[ ]not need, config updates happen on the fly!autosaved restart
- lockfile
- configuration
-
-
autosaved setup
: one time setup for getting config ready -
[LATER]
.autosaved.yaml
for each repository -
autosaved start
- Will read watched files from viper config, iterating over it at intervals of checkInterval
- Use select-case to block while listening for config and sleep timeout
- Don't autocommit when branch checkout out is autosaved's branch
-
autosaved stop
- send SIGTERM to lock process -
not need, config updates happen on the fly!autosaved restart
- stop and start -
autosaved watch
- add pwd to config