Presently #385 <https://github.com/leo-editor/leo-editor/issues/385> is 
titled "Leo doesn't honor new headlines when switching branches". However, 
there are more serious problems when switching or merging branches.

*tl;dr:* read the summary below.

*The problem*

I am in the midst of changing the code (*not *the effect) of how Leo writes 
section references, so that Leo can handle apparent section references when 
importing javascript code.  I want to develop and test new unit tests in 
*master*, not the js branch, so that unit tests verify *existing *behavior.

Alas, when switching branches, outline structure in external files seems to 
be controlled by the .leo files, not the sentinels in the external file.  
The --no-cache option has no effect.

As a result, it is difficult to switch between branches in such a way that 
Ctrl+Shift+W, write-at-file-nodes, doesn't change files when the branch 
changes outline structure.



*Workarounds*I have been thinking of this problem all day. Here are a few:

1. Ignore the problem: don't change files in master, and don't do 
write-at-file-nodes. This is feasible temporarily: I'll develop tests in 
unitTest.leo, which is not affected by this issue.

2. Use a *unique* copy of leoPy.leo for each branch, including master.  
There are two ways to do this:

- Recreate leoPy.leo from leoPyRef.leo whenever changing back to master, or 
when merging a branch into master.

- Delete all clones in leoPy.leo just before switching branches, after 
creating a per-branch copy of leoPy.leo.

*Proper solution*

Apparently, Leo should give priority to clones appearing in external 
files.  This implies a major change to Leo's read logic. It won't likely be 
easy, or pretty. Mistakes would be catastrophic.

*Summary*

There appear to be serious, ancient problems with how Leo recreates @file 
nodes from external files.

@clean nodes are likely immune from this exact problem: revised outline 
structure will be carried over from the branch to master.

Various workarounds must suffice until I can attempt a proper solution.

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