What about this:<br><br><br>use a file like '.bzrignore', let's say '.bzrtypes'.<br>The file is a list of wildcard expressions (regex and/or glob) and a set of flags.<br>Each line starts with a wildcard expression. The expression is used to match
<br>absolute file names. Behind the expression is a set of flags which tell bzr what to<br>do with the file. Possible flags are (defaults in brackets):<br><br>&nbsp; - store-delta&nbsp; (store complete)<br>&nbsp; - diff (do not diff because it is a binary or it does not make sense)
<br>&nbsp; - merge (do not attempt to merge file when doing bzr merge, because it is binary or it does not make sense)<br>&nbsp; - replaceEOF (do not touch the file)<br>&nbsp; - substituteKeywords (do not touch the file)<br>&nbsp; - .....<br>
<br>The expressions are evaluated top down. The first hit determines what flags are applied to the file.<br>When no expression matches a filename, then bzr uses the most conservative settings.<br><br>Here is an example:<br>
<br>============ start ===============<br><br>.*?\/config\/.*?\.xml&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; delta, diff, merge, replaceEOF<br>.*?\.xml&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; delta, diff, merge, replaceEOF, substituteKeywords<br>.*?\.ps&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; delta
<br><br>============ end&nbsp; ===============<br><br>First line:&nbsp; all xml files in all config directories are treated like source files but without keyword substitution.<br>Second line: all other xml files are treated like source files
<br>Third line: all postscript files can be stored as ascii files, but it makes no sense to diff or merge them<br><br>all other files are stored in the repository as they are or using a binary diff, the user will never see a diff output, bzr will never try to merge those files, ....
<br><br>I think this will give you a fair amount of flexebility and the schema can be expanded later, introducing new flags.<br><br><br>Ciao,<br>&nbsp; Steffen<br><br>
<br><div><span class="gmail_quote">On 11/3/06, <b class="gmail_sendername">Nicholas Allen</b> &lt;<a href="mailto:allen@ableton.com">allen@ableton.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
John and I were discussing this issue yesterday and I thought it might<br>be useful to bring up the problem so it can be discussed here.<br><br>Handling end of line conversions is something that an RCS needs to do<br>*really* well so that the same files can be edited in multiple OSs that
<br>have different line ending styles and file encodings. It would also be<br>nice that bzr could tell a text from a binary because it may wish to do<br>other conversions such as keyword expansion as well as line ending and
<br>file encoding translations (that would never be done for binary files).<br>So to me at least, it is clear we need some way to tell bzr what is text<br>and what is binary (or at least what conversions should be done on a file).
<br><br>I think, for text files, it would make sense to store them in the<br>repository using one line ending style. This will prevent massive diffs<br>happenning in the repo when the same file is edited on different OSs and
<br>the line endings are converted back and forth. I think it would make<br>sense to store the text files with the \n character rather than windows<br>\r\n as it is shorter and makes more sense anyway.<br><br>As I understand it, Bazaar does&nbsp;&nbsp;not do any conversion yet as there is
<br>the risk for data loss (for example, a file that is binary is mistakenly<br>assumed to be a text file and the \r character codes get stripped from<br>it). The way CVS does it is really bad and it often makes mistakes by
<br>assuming that all files are text files unless the user specifies that<br>they are binary (and often users forget this). So CVSs policy is one of<br>data destruction by default and I do not think this would be a good idea
<br>for bzr!<br><br>Subversion is much better and with its auto property setting feature<br>and, in my experience with it at least, it works pretty well. In fact, I<br>have not had a problem with it at all so the assumption that everything
<br>is binary unless otherwise stated seems to be a good solution in my opinion.<br><br>I think what Bazaar should do is have some sensible defaults and always<br>assume binary unless told otherwise. If it thinks a file is text (eg
<br>because it ends in an extension that the user has explicitly configured<br>as a text file) but it determines that the file has binary bytes in it<br>(text files don't have a \0 character in them but binary files very<br>
often do for example) then it could warn the user when they add the file<br>and turn off all conversions. This would be a rare case but a valuable<br>extra check just to make sure it doesn't do line end conversion on what
<br>is really a binary file. It would also be possible, but not nearly as<br>useful, to do a check for the opposite situation - so it could give a<br>warning to a file that it thinks is binary but contains no binary<br>characters and the user may wish to add conversions to it.
<br><br>It would not be until commit time that any data is converted&nbsp;&nbsp;and these<br>warnings would be before commit time and would therefore deal with the<br>majority of data loss concerns. I think this kind of solution would do
<br>the right thing the majority of the time and be very unlikely to loose<br>data. It's similar to svn but would also double check that conversions<br>really should be applied when the user sets up auto conversions and the
<br>file appears to contain some binary chars. So it would be safer than svn<br>and I have not even had a problem with svn yet.<br><br>Cheers,<br><br>Nick<br><br><br><br></blockquote></div><br>