On Thu, Nov 12, 2015 at 8:12 PM, Georg Baum <georg.b...@post.rwth-aachen.de> wrote: > 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.
Yes. And if we implement an option to keep the old authors (to be vcs friendly), we should be aware of privacy issues. Storing someone's name and e-mail address in a document, while there is no visible remnant left anymore might cause unwanted issues. For instance, someone puts the lyx document on the internet, after having accepted all changes, etc. > > 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. Yes. Completely true. Why do we store the author list in the list ? Apparently, the author list is composed of all authors having changes in the document. This doesn't need to be stored in the file then, because this duplicates info. It probably is there only to store the name and e-mail in one place to where can be refered in the rest of the document. Adding a dummy author isn't very useful then, because it doesn't add info. Then, if the author line is not present, we just don't show the author name and email address in the gui. We could also add a preference "Anonymous change tracking", instead of using the user's name and e-mail. I just don't like changing the document while reading it. > > 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) > >.... > > 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. I believe that 'git' can have custom merge filter/script for certain file types. Maybe the community would like a special LyX-merger script that can be used by the vcs to reduce merge errors as much as possible. Vincent