Vincent van Ravesteijn wrote: > I doubt whether it is a good thing to start fiddling with the document > when we read in a corrupt file. > > Version control systems can corrupt a file in so many ways.. do we > really want to raise the impression we could read it in properly but > in the mean time things are lost.
In general I agree. However, this is a very special case, because LyX currently actively provokes wrong merges, by removing \author lines if no change of this author remains in the document. Unfortunately there is a good reason for this behaviour: If LyX would not do that, then unused \author lines could easily accumulate: If I accept all changes of my co-author, and he never edits the file again, then his \author line will remain in the file forever. This should be prevented IMHO. I don't know if there is a solution for the messed up \author lines, but I think the other part of the patch (creating a dummy author if no author is present) is a good thing: It replaces one way of dealing with a corrupt document with a better one. If we wanted to be strict, then the current behaviour of throwing away the changes is as bad as the proposed patch, and we should refuse to load the file and force the user to fix the broken merge. Unfortunately there is another cause of corrupt merges: LyX files can have many copies of a few identical lines, e.g. (taken from the user guide) \end_layout \end_inset \end_layout \end_inset \end_layout \begin_layout Standard This can easily lead to wrong merges if two authors edit nearby parts of the document, where the VCS thinks that the merge was OK, although it is not. This should be prevented by changing the file format so that it does not contain so many repetitions. Georg