Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] Git as a storage provider #753

Open
harmancasvi opened this issue Sep 3, 2018 · 24 comments
Open

[Feature request] Git as a storage provider #753

harmancasvi opened this issue Sep 3, 2018 · 24 comments
Labels

Comments

@harmancasvi
Copy link

@harmancasvi harmancasvi commented Sep 3, 2018

Operating system

  • Windows
  • macOS
  • Linux
  • Android
  • iOS

Application

  • Desktop
  • Mobile
  • Terminal

First of all, I thank all the good people who make this app possible. I'd code to make it better but you'd get more trouble than benefit from my coding skills hahaha...

Heres's my suggestionion: please implement git as storage provider. Like GitHub or GitLab work as the storage provider for pass, that could even give us versioned notes 8-)
Im thinking about using a single git group/sub-group/repo, whichever picks the user, no matter if the repo is public or private, we'd restrict Joplin to a repo and down there our notepads as directories, with sub directories and notes.

This app uses gists for git notes on the CLI, you could check it out if it helps.

Thank you!

@mschaaf

This comment has been minimized.

Copy link

@mschaaf mschaaf commented Sep 18, 2018

I use a remote git repository already for sharing between devices:

  1. create a repo in github, gitlab or anywhere else
  2. checkout on desktop via git
  3. checkout on android via mgit
  4. use ssh keys to acces the repo
  5. sync to filesystem on your desktop and android device
  6. on the desktop i have a script that automates the synchronisation and commit and push process
  7. on android it is a manual step of commit and push via mgit
@harmancasvi

This comment has been minimized.

Copy link
Author

@harmancasvi harmancasvi commented Sep 18, 2018

@mschaaf thank you for the suggestion, I know I can sync via git, not as an app supported feature tough.

The benefit of having it integrated into the app is that it would run on Android AND iOS without extra effort. It's also good to use the app's internal storage [on mobiles] and not having to git checkout, git commit and git push manually while relying in some folder in the public storage.

The reason I provided pass as an example is that you setup the git related info and they take care of the sync process before/after every change, just like using any other provider (but better!).

Don't get me wrong @mschaaf , I do appreciate your guide (it might be very useful for git newcomers), it's just that I'd like to see the app integrate such an important feature without needing my own tricks to make it work on external folders.

Regards.

@stv0g

This comment has been minimized.

Copy link

@stv0g stv0g commented Jan 19, 2019

I think adding Git support might be possible by extending the existing directory backend.
On the desktop clients, we could simply rely on the system Git installation.
However, this becomes more difficult on the mobile clients. Bundling a Git version seems a bit inelegant.

I am wondering how the Android pass app is handling it?

@stv0g

This comment has been minimized.

Copy link

@stv0g stv0g commented Jan 19, 2019

@virtadpt Thanks. Seems like they use jGit

@harmancasvi

This comment has been minimized.

Copy link
Author

@harmancasvi harmancasvi commented Jan 19, 2019

@cbop-dev

This comment has been minimized.

Copy link

@cbop-dev cbop-dev commented Apr 13, 2019

There's also isomorphic-git, an open-source javascript git library which works for node, browsers, and android, and seems to be actively developed.

@goodevilgenius

This comment has been minimized.

Copy link

@goodevilgenius goodevilgenius commented Apr 15, 2019

I made this work myself by syncing to filesystem and using a local git repo as my target. And then I set up a very simple auto-syncing mechanism for that repo to regularly push/pull from remote. I even managed to get it to work on Android with the addition of Termux and Tasker.

Here's my code to make it work: https://gitlab.com/danjones000/simple-git-sync

@berot3

This comment has been minimized.

Copy link

@berot3 berot3 commented Sep 20, 2019

from #1619:

That's not technically possible at the moment.

But maybe we can still leave this one open so it won't be forgotten to think of in the future! 😃

@virtadpt

This comment has been minimized.

Copy link

@virtadpt virtadpt commented Sep 20, 2019

Please. I don't have a use case for it right now, but I can think of quite a few of them (least of all, Keybase's Git server functionality).

@stale

This comment has been minimized.

Copy link

@stale stale bot commented Dec 19, 2019

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may comment on the issue and I will leave it open. Thank you for your contributions.

@stale stale bot added stale and removed stale labels Dec 19, 2019
@harmancasvi

This comment has been minimized.

Copy link
Author

@harmancasvi harmancasvi commented Dec 20, 2019

Any news on this? Is it really just me who wants tis feature so badly?

I can't code properly that's why I haven't done it myself, but I don't think it would be that difficult for a proper programmer.

Passwordstore looks like good place to look IMO. Has any kind developer had the opportunity take a look at @stv0g or @cbop-dev 's suggestions?

@virtadpt

This comment has been minimized.

Copy link

@virtadpt virtadpt commented Dec 20, 2019

It's not just you. I'd love to have it. I was able to work around it with WebDAV, which is why I'm not complaining too hard about it.
If it wasn't an Electron app, I'd be working on it, too.

@stv0g

This comment has been minimized.

Copy link

@stv0g stv0g commented Dec 21, 2019

I am also still interested in this feature

@tessus

This comment has been minimized.

Copy link
Collaborator

@tessus tessus commented Jan 18, 2020

I think a git storage provider is not going to happen. Please be aware that Joplin is a react-native app. Git would require us to add key support to Joplin, which could be tricky. (Tricky, because of react-native.)
Besides that, how would one handle merge conflicts? Joplin is not a git client, nor does it have a diff engine included.

I understand that git sounds great as a storage provider, but the architectural design to get it right is out of the scope of this project. But maybe I'm wrong. @laurent22 makes the decisions, so let's see what he has to say.

@virtadpt

This comment has been minimized.

Copy link

@virtadpt virtadpt commented Jan 20, 2020

Maybe this would be a good place to start?
https://github.com/isomorphic-git/isomorphic-git

@Khorsan

This comment has been minimized.

Copy link

@Khorsan Khorsan commented Mar 5, 2020

Besides that, how would one handle merge conflicts? Joplin is not a git client, nor does it have a diff engine included.

@tessus In my point of view, git would be just used as a storage provider addon (the storage would be local). Joplin doesn't need to do diffs, i think. Diff is a git feature and you could do that on any cloud host (Github, GitLab, etc).

@tessus

This comment has been minimized.

Copy link
Collaborator

@tessus tessus commented Mar 5, 2020

Ok, then, please explain the process to me, because I really don't know how this could work in any other way than starting a new project.

git follows a distributed approach, which means you always require a local copy, so if you really wanted to use git, you'd have to use a local copy and a remote. The remote requires authentication, which I've already explained is hard to implemenent due to the react-native code base.
So who fixes the pull/push conflicts? Are you going to do that manually? Because Joplin can't do that for you. Joplin is not a git client either, so we'd also need a git component in Joplin.

Another discussion point:

Are you talking about the data at rest or the sync target? Don't forget that we use a sqlite db to store local notes. The entire code dpends on it. So rewriting that part of the code would be excessive. And then you still had the problem of rsolving conflicts between the data at rest and the sync target.

@Khorsan

This comment has been minimized.

Copy link

@Khorsan Khorsan commented Mar 6, 2020

@Drallas

This comment has been minimized.

Copy link

@Drallas Drallas commented Mar 25, 2020

I also would like to have GitHub / GitLb Sync support. I'm syncing to a local folder that is a local Git Repo. But native support would be nicer!

@GETandSELECT

This comment has been minimized.

Copy link

@GETandSELECT GETandSELECT commented Mar 29, 2020

@mschaaf

on the desktop i have a script that automates the synchronisation and commit and push process

please share the script in a gist

@Drallas

This comment has been minimized.

Copy link

@Drallas Drallas commented Mar 29, 2020

@mschaaf

on the desktop i have a script that automates the synchronisation and commit and push process

please share the script in a gist

I use something like this plain and simple script :
https://gist.github.com/Drallas/8c57dc87c05648d5cbac4f0a743d6ce5

  1. My Joplin Sync Folder has a .git repo connected to upstream Git Repo.
  2. My Joplin Syncs with File System to this Joplin Sync Folder.

And an alias in my .~/.bash_aliases file.
alias jopsync="/path/to/joplin/sync/folder/joplinsynctogitrepo.sh"

@mschaaf

This comment has been minimized.

Copy link

@mschaaf mschaaf commented Mar 29, 2020

@GETandSELECT the script can be found here https://gist.github.com/mschaaf/0fd33587d3d6220abdff4a391a68cf83
It should be as system independent as possible so it should be only necessary to change the path to the repository.

@goodevilgenius

This comment has been minimized.

Copy link

@goodevilgenius goodevilgenius commented Mar 29, 2020

@mschaaf

on the desktop i have a script that automates the synchronisation and commit and push process

please share the script in a gist

I mentioned mine earlier in the thread, but here it is again: https://gitlab.com/danjones000/simple-git-sync

I use this for a number of things, and it works really well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
You can’t perform that action at this time.