From mboxrd@z Thu Jan 1 00:00:00 1970 From: Salikh Zakirov Subject: git-apply can't apply patches to CRLF-files Date: Fri, 26 May 2006 20:00:42 +0400 Message-ID: <4477262A.5000301@Intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-From: git-owner@vger.kernel.org Fri May 26 18:02:22 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 1Fjekc-0000rL-5X for gcvg-git@gmane.org; Fri, 26 May 2006 18:01:22 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750891AbWEZQBR (ORCPT ); Fri, 26 May 2006 12:01:17 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750899AbWEZQBR (ORCPT ); Fri, 26 May 2006 12:01:17 -0400 Received: from mga01.intel.com ([192.55.52.88]:26523 "EHLO fmsmga101-1.fm.intel.com") by vger.kernel.org with ESMTP id S1750883AbWEZQBQ (ORCPT ); Fri, 26 May 2006 12:01:16 -0400 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101-1.fm.intel.com with ESMTP; 26 May 2006 09:01:16 -0700 Received: from fmsmsx331.fm.intel.com (HELO fmsmsx331.amr.corp.intel.com) ([132.233.42.156]) by fmsmga001.fm.intel.com with ESMTP; 26 May 2006 09:01:01 -0700 X-IronPort-AV: i="4.05,177,1146466800"; d="scan'208"; a="42966902:sNHT22129401413" Received: from fmsmsx311.amr.corp.intel.com ([132.233.42.214]) by fmsmsx331.amr.corp.intel.com with Microsoft SMTPSVC(6.0.3790.1830); Fri, 26 May 2006 09:01:00 -0700 Received: from mssmsx402.ccr.corp.intel.com ([10.125.2.12]) by fmsmsx311.amr.corp.intel.com with Microsoft SMTPSVC(6.0.3790.1830); Fri, 26 May 2006 09:00:59 -0700 Received: from [10.125.151.180] ([10.125.151.180]) by mssmsx402.ccr.corp.intel.com with Microsoft SMTPSVC(6.0.3790.211); Fri, 26 May 2006 20:00:56 +0400 User-Agent: Thunderbird 1.5 (Windows/20051201) To: git@vger.kernel.org X-OriginalArrivalTime: 26 May 2006 16:00:56.0189 (UTC) FILETIME=[929342D0:01C680DD] Sender: git-owner@vger.kernel.org Precedence: bulk X-Mailing-List: git@vger.kernel.org Archived-At: Hello, git-apply can't apply the patch to file with windows-style CRLF line endings, even if the patch was generated by git-format-patch. Is this a bug or known deficiency? The following script reproduces the problem --------- #!/bin/sh set -e mkdir trash cd trash git init-db echo "abc" > a unix2dos a git add a git commit -m "a added" a echo "cde" >> a unix2dos a git commit -m "a modified" a git format-patch HEAD^ git reset --hard HEAD^ git am 0001*.txt --------- The resulting output is --------- $ ./test defaulting to local storage area a: done. Committing initial tree 357c56061b96c1548b15168bc0d02e8d1a319e0b a: done. 0001-a-modified.txt Applying 'a modified' error: patch failed: a:1 error: a: patch does not apply Patch failed at 0001. When you have resolved this problem run "git-am --resolved". If you would prefer to skip this patch, instead run "git-am --skip". --------- If I remove unix2dos calls and so the file has normal unix LF line endings, then the result is correct as expected --------- $ ./test defaulting to local storage area Committing initial tree 6afc8719a182fed19980da0e53d13fba1f94dd3f 0001-a-modified.txt Applying 'a modified' Wrote tree 49f5181a399bbcaac1da3bf693c466a281c4a255 Committed: 2b0a2936d0a65b3511882b8e88586ab054dd15b2 ---------