# Failed binary detection.

3 messages from 2007-12-21 to 2007-12-21. Participants: David Brown, Dmitry V. Levin, Sean.
Thread: https://gitlist.dev/t/11386

## David Brown, 2007-12-21 19:50

Subject: Failed binary detection.
Message-ID: <20071221195019.GA20668@old.davidb.org>
URL: https://gitlist.dev/e/20071221195019.GA20668%40old.davidb.org

```
A coworker has a branch with some large binary files (video test streams).
Git doesn't seem to be detecting this file is binary, and is causing things
that try to generate diffs to fail.

Specifically, he is unable to rebase his branch, getting an error:

.dotest/patch:3241:LD   := ld
fatal: corrupt patch at line 84682
Patch failed at 0001.

Line 84682 is in the middle of what appear to be the binary contents of the
large media file, with pluses inserted after newline.

Any advice on where to look or possibly how to fix this?

I was able to work around the problem by cherry picking the change instead
of using rebase.  git-format-patch generates a patch that is corrupt in the
same way, which fails with 'git-am'.

Thanks,
Dave

```

## Dmitry V. Levin, 2007-12-21 23:00

Subject: Re: Failed binary detection.
Message-ID: <20071221230045.GA9442@wo.int.altlinux.org>
URL: https://gitlist.dev/e/20071221230045.GA9442%40wo.int.altlinux.org
In-Reply-To: <20071221195019.GA20668@old.davidb.org>

```
On Fri, Dec 21, 2007 at 11:50:19AM -0800, David Brown wrote:
> A coworker has a branch with some large binary files (video test streams).
> Git doesn't seem to be detecting this file is binary, and is causing things
> that try to generate diffs to fail.
> 
> Specifically, he is unable to rebase his branch, getting an error:
> 
> .dotest/patch:3241:LD   := ld
> fatal: corrupt patch at line 84682
> Patch failed at 0001.
> 
> Line 84682 is in the middle of what appear to be the binary contents of the
> large media file, with pluses inserted after newline.
> 
> Any advice on where to look or possibly how to fix this?

See discussion of this issue in git archives, e.g.
http://marc.info/?t=119652720900002


-- 
ldv

```

## Sean, 2007-12-21 23:02

Subject: Re: Failed binary detection.
Message-ID: <BAYC1-PASMTP0471A96A025F672FF637C8AE5E0@CEZ.ICE>
URL: https://gitlist.dev/e/BAYC1-PASMTP0471A96A025F672FF637C8AE5E0%40CEZ.ICE
In-Reply-To: <20071221195019.GA20668@old.davidb.org>

```
On Fri, 21 Dec 2007 11:50:19 -0800
David Brown <git@davidb.org> wrote:

> A coworker has a branch with some large binary files (video test streams).
> Git doesn't seem to be detecting this file is binary, and is causing things
> that try to generate diffs to fail.
> 
> Specifically, he is unable to rebase his branch, getting an error:
> 
> .dotest/patch:3241:LD   := ld
> fatal: corrupt patch at line 84682
> Patch failed at 0001.
> 
> Line 84682 is in the middle of what appear to be the binary contents of the
> large media file, with pluses inserted after newline.
> 
> Any advice on where to look or possibly how to fix this?
> 
> I was able to work around the problem by cherry picking the change instead
> of using rebase.  git-format-patch generates a patch that is corrupt in the
> same way, which fails with 'git-am'.
> 

Dave,

Telling Git that the file is binary is likely all you need to do.  Something
like the following line in a .gitattributes file:

filename -diff

For more info see "man gitattributes".

HTH,
Sean

```
