From: Carl Worth Subject: Why is there a --binary option needed for git-apply? Date: Tue, 05 Sep 2006 11:40:53 -0700 Message-ID: <874pvmxikq.wl%cworth@cworth.org> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: multipart/signed; boundary="pgp-sign-Multipart_Tue_Sep__5_11:40:46_2006-1"; micalg=pgp-sha1; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit X-From: git-owner@vger.kernel.org Tue Sep 05 20:41:34 2006 Return-path: Envelope-to: gcvg-git@gmane.org Received: from vger.kernel.org ([209.132.176.167]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GKfrB-0008Bl-09 for gcvg-git@gmane.org; Tue, 05 Sep 2006 20:41:09 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030205AbWIESk4 (ORCPT ); Tue, 5 Sep 2006 14:40:56 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932210AbWIESk4 (ORCPT ); Tue, 5 Sep 2006 14:40:56 -0400 Received: from cworth.org ([217.160.249.188]:11154 "EHLO theworths.org") by vger.kernel.org with ESMTP id S932204AbWIESkz (ORCPT ); Tue, 5 Sep 2006 14:40:55 -0400 Received: (qmail 31737 invoked from network); 5 Sep 2006 14:40:54 -0400 Received: from localhost (HELO raht.cworth.org) (127.0.0.1) by localhost with SMTP; 5 Sep 2006 14:40:54 -0400 To: git@vger.kernel.org User-Agent: Wanderlust/2.14.0 (Africa) Emacs/21.4 Mule/5.0 (SAKAKI) Sender: git-owner@vger.kernel.org Precedence: bulk X-Mailing-List: git@vger.kernel.org Archived-At: --pgp-sign-Multipart_Tue_Sep__5_11:40:46_2006-1 Content-Type: text/plain; charset=US-ASCII I was recently emailed a patch that introduced some new binary files to my repository. The patch included a very pleasant-looking chunk along the lines of: diff --git a/new/file.png b/new/file.png new file mode 100644 index 0000000000000000000000000000000000000000..e7edd8141e15f5753ea94244e7315bd1341a8c05 GIT binary patch I tried applying the patch with git-apply (1.4.2.rc2.gef1d9) and received an inscrutable error: fatal: patch with only garbage at line 90 Where line 90 happened to be the line after the first chunk. I was disappointed that the operation had failed and started guessing at problem causes (git version incompatibilities? MUA whitespace munging?). Shawn Pearce was kind enough to direct me to the --binary option for git-apply which solved my problem. But that left me wondering why git-apply requires this extra command-line option to do its job. Shouldn't git-apply simply apply the patch it is given? If there is some reason for git-apply to only apply binary patches when under the duress of --binary, then at the very least it could use a better error message explaining the situation. -Carl -- cworth@redhat.com --pgp-sign-Multipart_Tue_Sep__5_11:40:46_2006-1 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (GNU/Linux) iD8DBQBE/cS16JDdNq8qSWgRAnWBAKCVcFn8WV6VFy9WrSaZ7w5OUhZW8ACeL0Sm GZWUkOmtHZG97BsrKwlh79w= =/F+Z -----END PGP SIGNATURE----- --pgp-sign-Multipart_Tue_Sep__5_11:40:46_2006-1--