taskbook icon indicating copy to clipboard operation
taskbook copied to clipboard

Adding git support

Open signorekai opened this issue 7 years ago • 13 comments

Is your feature request related to a problem? Please describe. Love the interface, would love the ability to sync tasks to multiple computers

Describe the solution you'd like Adding an optional git property to the config file that would auto git add . & git commit -m "Added task - Submitting a feature request to @personal" on each CRUD action (example here is on tb -t @personal Submitting a feature request.

Additional context Wouldn't mind doing this myself, just thought I'd put it here first to prevent duplication of work.

signorekai avatar Aug 01 '18 09:08 signorekai

I agree, something similar to https://www.passwordstore.org would be great.

For example:

tb git remote add ...
tb git push origin master

smirzaei avatar Aug 02 '18 11:08 smirzaei

@smirzaei Should the git commands sync with remote automatically, or only on request?

kalexmills avatar Aug 02 '18 11:08 kalexmills

@kalexmills Well the "unix password manager" automatically creates a commit when you add, modify or remove a password. But it's up to you to manually sync it (push/pull)

I quite like how it works. It exposes all the git functionality through pass git [git command] and it feels very flexible.

Some examples: https://wiki.archlinux.org/index.php/Pass#On_the_client

So in this case a simple flow would be like:

tb git init # The git functionality is optional
tb git remote add origin [email protected]:...
tb --task foo # A modification (here taskbook automatically creates a commit)
tb git push origin master # sync changes with the upstream

Of course this is just a suggestion. Thanks for creating this app!

smirzaei avatar Aug 02 '18 12:08 smirzaei

Either one is better than neither, but I personally would find myself forgetting to push tasks.

Might be nice to have sync happen automatically in the background (although that clearly is an additional feature).

kalexmills avatar Aug 02 '18 12:08 kalexmills

I personally would find myself forgetting to push tasks

Yep happens quite often 😅

smirzaei avatar Aug 02 '18 12:08 smirzaei

I concur. I'd rather have it auto push so that I definitely have it synced.

On Thu, 2 Aug 2018, 8:30 PM Soroush Mirzaei, [email protected] wrote:

I personally would find myself forgetting to push tasks

Yep happens quite often 😅

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/klauscfhq/taskbook/issues/16#issuecomment-409909577, or mute the thread https://github.com/notifications/unsubscribe-auth/ALms18PSWyNrPMLPZhpiNtIraxgNFFnzks5uMvDxgaJpZM4VqItM .

signorekai avatar Aug 02 '18 12:08 signorekai

So should auto-sync be a separate feature / ticket?

kalexmills avatar Aug 02 '18 17:08 kalexmills

Is the use of git here simply to use git as a storage provider or is there more? It seems like git is pretty different than the storage provider this project is using, which is a pretty basic JSON store.

Also, though git is popular, it seems a bit odd to be thinking of this program as a wrapper around git... if you wanted to use git, what if there was instead a way to customize post-command hooks that get run. That way you could hook up taskbook to add and commit within your storage directory after each command?

knappg avatar Aug 08 '18 04:08 knappg

@knappg Yep, seems the one big JSON document for all tasks would end up with conflicts quite often... I would think you would want many little documents, one per task, for git?

forbesmyester avatar Aug 08 '18 11:08 forbesmyester

Yep, seems the one big JSON document for all tasks would end up with conflicts quite often...

Yes, definitely. Unless the remote is only used as a backup, some other format would be needed to make things work more smoothly. The storage service will need to map between the format used in the remote git repo and the json file that taskbook is using to store tasks. This may be quite a development effort, but it would turn taskbook into a collaborative tool, which I think could be a neat idea.

Is the use of git here simply to use git as a storage provider or is there more?

My thought was that it was just a storage provider, although taking a look at the OP's commands, I might be mistaken.

...if you wanted to use git, what if there was instead a way to customize post-command hooks that get run.

This sounds like it would be a flexible approach. Other developers could even create suites of such hooks and make them available as plugins. (dream big! :cloud:)

kalexmills avatar Aug 13 '18 02:08 kalexmills

I was thinking about using it purely as a back-up, to synchronise between various devices I own, rather than collaborative, though a collaborative feature would be great too.

signorekai avatar Aug 13 '18 10:08 signorekai

@knappg various event hooks would work nicely, will do that instead!

signorekai avatar Aug 13 '18 10:08 signorekai

Regarding a collaborative git feature. Check out collabbook, a (mostly complete) Java taskbook clone I made that does the trick.

Using Java for this incurs a large startup penalty, but it serves as a PoC (heh).

kalexmills avatar Aug 20 '18 21:08 kalexmills