Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sort children during export to ensure a more stable format #4550

Merged
merged 1 commit into from
Jan 7, 2024

Conversation

spasche
Copy link
Contributor

@spasche spasche commented Dec 31, 2023

Hello,

I'm using a script to run a daily markdown export and commit the result to git for backup and to use git tools to browse history.

I'm using notes with clones and noticed that the export format is not stable. For instance, with two notes clones NoteA and NoteB, export on one day may produce NoteA.md + NoteB.clone.md and another day NoteA.clone.md + NoteB.md. This makes it harder to track history.

Looking at the code, I see that this may happen since the notes tree traversal doesn't sort the children by their notePosition attribute. This PR calls sortChildren to produce a more stable and reproducible export.

@zadam zadam merged commit 37baa4c into zadam:master Jan 7, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants