Stephen Leake <stephen_le...@stephe-leake.org> writes: > I can invent an attr 'os_line_endings', and add a function to the > 'attr_functions' hook to change the file line ending on workspace > update. But that doesn't fix the bogus changes reported by 'mtn status'. > In fact, it makes it worse; I only get the bogus changes now when I > actually run Quartus. The same workspace contains Ada code, which I > compile far more often. With this attr, I'll get bogus changes all the > time. > > Looking thru the code for 'mtn status', it seems I need to modify > file_io.cc 'calculate_indent' to apply the reverse line ending > transformation before computing the file id.
Digging into this code further, it seems the most efficient approach is to define a Botan pipe filter that does the appropriate line ending conversion, and use that filter in file_io.cc read_data and calculate_ident. The inverse filter needs to be added to write_data. Normal files would not use any filter; files with a 'filter' attribute would use the filter named by the attribute. That makes it much harder for users to define arbitrary filters; only filters defined in the C++ code can be used. Although I suppose we could define a Botan filter that calls a Lua hook. I suspect useful filters will be in C++ anyway. I don't understand why read_data uses a Botan pipe at all, currently; any clues? Most other uses of Botan pipes involve some sort of hash computation. Another thing I don't understand is the Botan pipe cache. There is no way to retrieve anything from the cache, so it doesn't seem to be a storage mechanism. It seems to be a mechanism for delaying the destruction of pipes. What's the rationale for that? botan_pipe_cache.hh says what the cache does, but not why we need it. -- -- Stephe _______________________________________________ Monotone-devel mailing list Monotone-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/monotone-devel