Binary file support

Robey Pointer robey at lag.net
Thu Oct 13 18:10:28 BST 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On 13 Oct 2005, at 6:39, Aaron Bentley wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Martin Pool wrote:
>
>> On 13/10/05, John Arbash Meinel <john at arbash-meinel.com> wrote:
>>
>>
>>> I know Aaron mentioned a patch in the past, to add a binary flag to
>>> files, so that we can more properly handle diff and merge.
>>>
>>
>>
>> I'd rather have bzr just notice that the file is binary and therefore
>> shouldn't be run through a text diff or merge.
>>
>
> Well, it depends on how and where you intend to detect binaries.
>
> diff's heuristic for 'binary' is reported to be 'contains NUL in the
> first 1k'.  For text diffing, another useful test is 'contains VT-102
> control characters'.

I think bzr should have a property on each file indicating whether it  
is text or binary.  Even if we end up weaving every filetype, it may  
be useful info for other reasons (like not bothering to "diff" binary  
files).  EIBTI.

But I think it's perfectly okay to guess the filetype when adding it,  
as long as the user can change that type later.  The heuristics above  
sound likely to work in most cases.

robey

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (Darwin)

iD8DBQFDTpUtQQDkKvyJ6cMRAuhUAJ95xqmOz0QLFV5mMed3sqTAnB/AgwCg5HRr
c3HJlBYmyDk2crPPH0cB2jw=
=5aHf
-----END PGP SIGNATURE-----




More information about the bazaar mailing list