dokuwiki-plugin-gitbacked icon indicating copy to clipboard operation
dokuwiki-plugin-gitbacked copied to clipboard

Add Revision for all altered pages on Pull

Open lowb1rd opened this issue 4 years ago • 5 comments
trafficstars

I would like to edit wiki pages with my favorite $EDITOR.

Commiting changes to a cloned repo and have the gitbacked-plugin pull it seems to work. The changes are applied but there is no new revision of a page.

I wonder if it would be possible to create a revision with the old state for all files affected with the pull?

Would that be a useful feature for the gitbacked-plugin?

lowb1rd avatar Sep 19 '21 14:09 lowb1rd

thanks @lowb1rd for your suggestion. I do not fully get it, could you describe the sequence more in detail what you do and what the plugin should do.

woolfg avatar Sep 20 '21 21:09 woolfg

Hi @woolfg - Thanks for replying. I'll try to explain.

I have a central (bare) git repo. Dokuwiki with gitbacked is configured to push to that repo. It is also configured to pull from that repo every x minutes.

This setup makes it possible for me to clone the bare repo and work on it loclly with my favorite editor! I then push changes to the bare repo and gitbacked will pull it from there.

The changes I make locally do make it into dokuwiki, but there is no new entry in the revision-list created. I figure that dokuwiki will detect an external edit and create a revision but only after I manually edit the page via the web interface.

So I wonder if it would be in the scope of this plugin to trigger the creation of a revision after a pull for affected pages.

lowb1rd avatar Sep 26 '21 15:09 lowb1rd

Hey @lowb1rd, so I am no longer a hardcore dokuwiki user but if I get you right, even dokuwiki doesn't recognize your external edits, right? This would make sense to me as I guess, dokuwiki is not made for that. If dokuwiki doesn't recognize the changes we can also not use a hook to trigger the git commit, but if you have more information how dokuwiki handles it, we can have a look. cheers.

woolfg avatar Nov 24 '21 09:11 woolfg

DokuWiki will normally only check for external edited pages just before a save of a page with the saveWikiText() function, as called via the wiki interface (and some xmlrpc api’s etc).

This plugin saves during the save just an extra copy in git, next to the existing mechanisms of DokuWiki. So the revision history is happening via the default mechanisms of DokuWiki.

If a history that’s is created externally (in git), needs to be added to DokuWiki, I think it is a possibility to implement that with history from git for each commit that is missing, the saveWikiText() could be used. A trigger could probably be connected to the periodic pull. Another approach is that the history that is shown in DokuWiki, is retrieved directly from git. That would mean major changes to current plugin, and is not trivial. In both cases, there is stuff needed to handle merges, and eventual conflicts.

Klap-in avatar Jan 13 '22 19:01 Klap-in

Creating page revisions for each commit via saveWikiText() during the periodic pull would be very useful.

Nils98Ar avatar Oct 01 '23 09:10 Nils98Ar