Jrnl: Git support

Created on 16 Feb 2016  路  14Comments  路  Source: jrnl-org/jrnl

The basic interface would just funnel git commands through the jrnl command and do the expected git command:

jrnl git init
jrnl git push
jrnl git pull

My model for this is the great pass tool from https://git.zx2c4.com/password-store/

enhancement needs more info stale

Most helpful comment

I see the utility of this, but don't really want to have jrnl know about what environment it's running in. The way that we can all have our cake and eat it, too, is to implement hooks. We're not 100% ready for this, but it'll be coming down the line, and this seems like a great use-case for hooks.

I'm putting this into the ideas bucket so we don't lose track of it.

All 14 comments

I currently just have some bash/zsh functions that allow me to a jrnlpush command to backup my journal. But integration would be awesome.

@powellc - I get what youre trying to get at with this. I do think if were gonna go git though, we should consider autopushing after each submission.

That's a fair point. For what it's worth, pass doesn't do that, and I haven't been bit yet, but all you have to do is forget to push once when you add something and clone and edit it somewhere else and you're repo suddenly needs merge conflict resolution. When wrapped around a cli command, not awesome.

@powellc - true but that's probably the biggest push for antosyncing. I had no idea what merge conflicts were until I had to start using git manually vs just using something much more automated like the mac's git client which has one primary function, sync. A lot of people say automation makes a mess of git repos but if done carefully and thoughtfully, it can be done well.

People that are likely to be using git will probably understand enough about git to resolve a merge conflict. As the file formats are text, merge conflicts are likely to be easy to resolve, and you can documentation a graphical merge tool that makes it easier for people that aren't quite git-competent enough to do it manually.

I'd like to +1 this request.

I'm going to try using syncthing to synchronise my journal between devices:
https://syncthing.net/

I've used syncthing for other things successfully for over a year now.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Keep this open. I personally would like to see jrnl detect git repos similar to pass, and automatically commit any changes to the journal.

Hi! I don't use pass, so please forgive me if I don't fully understand the implementation, but I don't see how this would work with encrypted journals. Wouldn't an encrypted journal be treated essentially as a binary file (which git is notoriously bad with)?

I also don't understand how jrnl git push is any more useful than git push. It feels like an extra layer of complication for no new functionality. But maybe I'm missing something?

@wren, encrypted files are not optimal to store in git yes, but pass does it too. I don't personally use encryption with jrnl.

Regarding jrnl git <whatever>, sure, jrnl could pass git commands to the detected repository, and I can see how that would be useful convenience, but I'm personally more interested of automatically committing changes to the journal if it's detected to be a file in a git repository.

The reason for doing jrnl git <whatever> instead of just using git is you don't have to be in the directory for it. The wrapper would put you in the correct directory for it to operate on your journal repository.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

I see the utility of this, but don't really want to have jrnl know about what environment it's running in. The way that we can all have our cake and eat it, too, is to implement hooks. We're not 100% ready for this, but it'll be coming down the line, and this seems like a great use-case for hooks.

I'm putting this into the ideas bucket so we don't lose track of it.

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bjornasm picture bjornasm  路  8Comments

wren picture wren  路  3Comments

mandarvaze picture mandarvaze  路  6Comments

sloria picture sloria  路  6Comments

MarkWh1te picture MarkWh1te  路  5Comments