claudioc / jingo

Node.js based Wiki
MIT License
1.02k stars 183 forks source link

Can Jingo expose a remote API to trigger a git pull? #185

Open yusiwen opened 7 years ago

yusiwen commented 7 years ago

My use case is: I've my notes' git repo on git server remotely, cloned it on the same machine(which is not the git server) which runs Jingo. When I edited notes on my notebook, I push it to git repo. Then, I have to login my Jingo server, manually pull those commits for Jingo to be aware of them.

After reading the README, I've found Jingo can push to remote periodical according to pushInterval. But there isn't any pull mechanism I can found.

I'm wondering if there can be a remote api of Jingo, e.g. http://myhost/api/request-of-pull?ARG=VALUE...., to inform Jingo to pull from remote. And with that API, I can add a post-receive hook of my git repo on git server to call that API right after I pushed some new commits.

Is that possible? Thanks

claudioc commented 7 years ago

Hi,

before any push, Jingo always do a pull first from the remote. It's quite optimistic, since it doesn't try to resolve any conflict by itself of course.

So, if I understand correctly, the only thing you need is to activate the automatic push, so that you'll also have the pull issued. Is that correct?

concentrateddon commented 7 years ago

Yeah, I'd +1 that. The intent is, I've got my main repo on GitHub, and either periodically, or upon a GitHub web hook, I want Jingo to pull the latest repo. Having a web hook do it would be very cool, as GitHub calls those on each commit. The scenario here is a big team editing primarily in GitHub, versus editing in the website. Similarly, an option to actually disable the web editor would be neat. I know it's not the original vision, but it'd be very effective.