Re: [PATCH] xdiff-interface.c (buffer_is_binary): Remove buffer size limitation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Dec 01, 2007 at 11:46:52AM -0800, Junio C Hamano wrote:
> On Sat, Dec 01, 2007 at 07:01:13PM +0300, Dmitry V. Levin wrote:
> 
> > When checking buffer for NUL byte, do not limit size of buffer we check.
> > Otherwise we break git-rebase: git-format-patch may generate output which
> > git-mailinfo cannot handle properly.
> 
> I think this is tackling a valid problem but it is a wrong solution.
> The change penalizes text changes which is the majority, just in case
> there is an unusual change that has an embedded NUL far into the file
> (iow, exception).

Penalizes?
Average file size in the linux-2.6.23.9 kernel tree is 10944 bytes,
FIRST_FEW_BYTES limit is 8000 bytes.
Well, I prefer slightly penalized but working properly git-rebase.
Attached test case demonstrates how current git-rebase can just run
successfully but produce a wrong result.

P.S. The real life example where you can hit this git-rebase problem is
GNU .info files.


-- 
ldv

Attachment: t3408-rebase-binary-correctness.sh
Description: Bourne shell script

Attachment: pgpv8nEXx6gYZ.pgp
Description: PGP signature


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux