corinthia-editorlib repository

2 views
Skip to first unread message

Peter Kelly

unread,
Sep 13, 2015, 4:12:05 AM9/13/15
to corinthiateam
I’ve just re-imported the JS editing library into the corinthia-editorlib, providing full history of the code including 1,300 commits going back to not long after I started on it in October 2011. Previously, we’ve only ever had a small amount of history in the repository (in docformats it dates from an initial copy of the code I placed there in November 2014).

The commits now pushed were extracted from the main UX Write repository (which is not public). This involved quite a lot of git magic, with extensive use of filter-branch to extract just the subset of files relevant to the library, and handle a couple of times where I’d renamed the directory, rebasing to adjust the test harness files to point to the files in the right locations, and the odd cherry-pick to clean things up. Most commits have a running test suite; there are a few cases from long ago where changes in the organisation of the code happened prior to the test harness being updated, and in the very early commits the tests don’t run at all.

I’m hoping this might be helpful in cases where there’s a need to understand how a particular aspect of the library evolved over time (e.g. understanding how the Position_okForMovement function got so complicated). I also wanted it there to help me in writing the documentation, so I can hopefully provide a better explanation of the *why* behind the code, not just the *what* (I’ve long forgotten why I made certain choices, but the commit messages should trigger my memory).

The repository is organised into two directories: src and tests. For much of it’s life, tests was a subdirectory of src, but I’ve rewritten all the history to fix all references to that (including from the test harness). I suggest that we continue to maintain this same structure, as it allows us to examine the complete history of any piece of code without git getting confused about renames (git *can* track a rename when traversing the tree for a single file, but not for a directory or multiple files).

There’s no CMakeLists.txt or anything similar in repository, and it’s not usable in and of itself. The main entry point of interest is tests/testharness.html - if you load this in a browser you should be able to run all the tests. I know this works in Safari, but have not tested it in Firefox and in Chrome it only works if you run a local web server and load the files that way, due to security restrictions placed by Chrome on local file access.

I think the best way for the web app and qt app to include this is likely to be submodules - see https://git-scm.com/book/en/v2/Git-Tools-Submodules

I’ve kept the previous import that Jan made the other day in the master-old branch. However the files in src are exactly the same, and the main difference in the new master branch is that it also include all of the tests.

Next up comes the big job of writing API documentation :)

--
Dr. Peter M. Kelly
kell...@gmail.com

(fingerprint 5435 6718 59F0 DD1F BFA0 5E46 2523 BAA1 44AE 2966)

signature.asc
Reply all
Reply to author
Forward
0 new messages