Have you tried commands `set-reference-file`, `update-ref-file`  and 
`read-ref-file` instead?

In all of my projects, nowadays, I have public <project>-ref.leo and 
private <project>.leo pair of files. Inside the private Leo file, I set the 
reference file to be public <project>-ref.leo file. At the same time inside 
public Leo file, I have defined a button node with the headline `@button 
n-save @key=Ctrl-s` and the body like this:

c.save()
# if using @bool tree-declutter = True uncomment next line
# clean_uas()
c.fileCommands.save_ref()

Now, every time I press Ctrl-s to save the outline, public outline is 
updated accordingly. After executing `git pull` , I open my private outline 
and execute mini buffer command `read-ref-file` to synchronize private 
outline with the public one. After that I continue to work on my project 
using only private outline.

I don't really have collaborators to work on my projects, so I can't say 
that this setup has been battle tested. Sometimes I work on different 
machines and I haven't noticed any problem synchronizing work using this 
method. I haven't seen unexpectedly big diffs either.

HTH Vitalije

On Monday, December 5, 2022 at 2:30:05 PM UTC+1 Edward K. Ream wrote:

> LeoPyRef.leo defines this button. The button does the following:
>
> - Check that the button is running from leoPy.leo, not LeoPyRef.leo.
> - Updates LeoPyRef.leo using only specific subtrees of leoPy.leo.
>
> Félix and I have noticed that sometimes this script creates large diffs 
> between the old and new versions of LeoPyRef.leo.
>
> Instead, the following workflow seems to work better for me:
>
> - Save leoPy.leo as LeoPyRef.leo.
> - Load the new LeoPyRef.leo.
> - Delete unwanted parts of the new LeoPyRef.leo.
> - Execute the git-diff command within LeoPyRef.leo.
>
> The git-diff command will ensure I've not deleted too much :-)
>
> More importantly, the Leonine git-diff shows me the "real" diffs, 
> regardless of "extraneous" diffs caused by moving/alphabetizing nodes.
>
> *Summary*
>
> `@button write-leoPyRef` seems buggy in hard-to-pin-down ways.
>
> Updating LeoPyRef.leo "by hand" is safe, provided one checks the work 
> using Leo's git-diff command.
>
> Your comments, please.
>
> Edward
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/1d32ffa5-9d62-42a9-ad2d-114498c9f073n%40googlegroups.com.

Reply via email to