On Fri, Apr 25, 2014 at 10:26 AM, Jacob Peck <[email protected]> wrote:
>> 0. Let's use the same terminology as with @shadow: **private** files >> contain sentinels; **public** files do not. >> >> 1. Instead of writing sentinels *within* external files, Leo's file-write >> logic could easily create separate **sentinel files**. Sentinel files would >> contain: >> >> - a header with data such as sha1-hash for the corresponding public file, >> and a gnx-like author/timestamp field. >> > I might be wrong, but the sha1 hash will change when the file content > changes (that being the point of a hashing function). Correct > It might be wiser to > just hash the file name along with path information -- but that would still > break if/when directory structure changes. Also it would not be > cross-platform and prevent sharing sentinel data between users. We want to be able to reliably associate sentinel files with public files. As a secondary consideration, we probably don't want to many copies of sentinel files floating around. > Perhaps the best solution would be to use the db to establish links between > files in ~/.leo/sentinels and the public files? Just add a minibuffer > command or two to deal with these links, and the scheme would be golden > (even if manual). That's what the sha1 hash does. The exact details don't really matter in preliminary discussions. > >> - a list of sentinel lines themselves. Each sentinel line would be >> preceded by a relative offset of the sentinel within the corresponding >> public file. Using relative offsets means that most offsets would not >> change if a line were inserted/deleted from the public file. >> > So, like Sentinel A occurs 1 line before the line 'class Foo(Bar)'? I assume > things like that would have to guard against duplicates... Unless I'm > misunderstanding this bit. I was thinking that the relative offsets mean: n lines after the previous sentinel (or the start of the file for the first offset). This would allow sentinel files to remain mostly unchanged when the file changes, which would reduce git diffs. Thanks for these comments. Imo, the exact details don't matter much unless we actually intend to implement this scheme. That's not all that likely, imo, because it would only be useful in non-Leonine environments containing multiple Leo users. Still, the focus on sharing data (either external files with embedded sentinels, or the "compressed" sentinels files does seem to be useful. 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 http://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
