This is an Engineering Notebook post concerning the way forward with #505 
<https://github.com/leo-editor/leo-editor/issues/505>.

Discovering the simplest thing that could possibly work is *not* 
necessarily straightforward, and I don't believe I ever implied it was. 
Indeed, I have spent several days considering how to make progress on this 
oh-so-important item. Time in the bath, time studying cff's, and time 
making tiny tweaks to the code.  This "down time" has lead to...

Aha: The present code does not take full advantage of two fundamental facts:



*1. Leo reads the outline (.leo file) before reading external files (@<file 
trees).*The AtFile read code can assume that data in sentinels should 
override data in vnodes that were created while reading the .leo file.


*2. Clones in a .leo file are (almost) always in sync.*
Saving a .leo file will save *all* external files containing a changed 
clone. See p.setAllAncestorAtFileNodesDirty.

*Changing git branches should never cause clones to get out of sync. *There 
are only two *extremely rare *ways to get clones out of sync:

A. Editing a clone in an external file outside of Leo.

B. The user could use write-at-file-nodes to write some changed external 
files, but not others, and then not save the .leo file when prompted to do 
so.

*Summary*

Leo should be able to switch git branches without using priorities. Only in 
*extremely 
rare* case will Leo need to use a priority scheme to choose between data. 
This can be done *later* by adding temp data to vnodes.

The entire recovered-nodes machinery will likely disappear, as will other 
special cases. (Something like recovered nodes reappear in the upcoming git 
diff code).

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 post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to