From MAILER-DAEMON Wed Aug 10 10:55:15 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QrABf-00006M-TY
	for mharc-bug-patch@gnu.org; Wed, 10 Aug 2011 10:55:15 -0400
Received: from eggs.gnu.org ([140.186.70.92]:54411)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QrABa-000053-FX
	for bug-patch@gnu.org; Wed, 10 Aug 2011 10:55:14 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QrABW-0001iz-Nm
	for bug-patch@gnu.org; Wed, 10 Aug 2011 10:55:10 -0400
Received: from mx.meyering.net ([82.230.74.64]:35931)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QrABW-0001hs-Dt
	for bug-patch@gnu.org; Wed, 10 Aug 2011 10:55:06 -0400
Received: from rho.meyering.net (localhost.localdomain [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id 8E48F6005B
	for <bug-patch@gnu.org>; Wed, 10 Aug 2011 16:55:05 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: bug-patch@gnu.org
Date: Wed, 10 Aug 2011 16:55:05 +0200
Message-ID: <87ei0t48qe.fsf@rho.meyering.net>
Lines: 113
MIME-Version: 1.0
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 82.230.74.64
Subject: [bug-patch] [PATCH 1/2] build: include .version in tarball to avoid
	distcheck failure
X-BeenThere: bug-patch@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports, suggestions,
	general discussion for GNU patch." <bug-patch.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-patch>,
	<mailto:bug-patch-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-patch>
List-Post: <mailto:bug-patch@gnu.org>
List-Help: <mailto:bug-patch-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-patch>,
	<mailto:bug-patch-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 10 Aug 2011 14:55:14 -0000

Here are two patches:

The first prevents make distcheck failure,
and the second helps Mac OS 10.5 users who use patch
to operate on very large files.

>From f935ba6ad3b2e2962a7ca7d7204d168a6c008d53 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Mon, 1 Aug 2011 10:09:25 +0200
Subject: [PATCH 1/2] build: include .version in tarball to avoid distcheck
 failure

* Makefile.am (EXTRA_DIST): Append .version, to avoid "make distcheck"
failure when run from an unpacked tarball.
Reported by Iain Nicol.
---
 Makefile.am |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 87854a9..311b4b8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -36,6 +36,7 @@ else
   GNU_SERVER = ftp.gnu.org
 endif

+EXTRA_DIST += $(top_srcdir)/.version
 BUILT_SOURCES = $(top_srcdir)/.version
 $(top_srcdir)/.version:
 	echo $(VERSION) > $@-t && mv $@-t $@
--
1.7.6.433.g1421f


>From 79348dbd2be9ceb50e77e58db55438da65ada148 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Wed, 10 Aug 2011 15:52:02 +0200
Subject: [PATCH 2/2] build: use largefile module and update to latest gnulib

* configure.ac: Remove AC_SYS_LARGEFILE, subsumed by ...
* bootstrap.conf (gnulib_modules): ...this.  Use largefile module.
* gnulib: Update to latest.
This is useful to Mac OS X 10.5 users if/when configure
is generated using autoconf prior to v2.68-80-gdb2f2e0.
---
 bootstrap.conf |    1 +
 configure.ac   |    1 -
 gnulib         |    2 +-
 m4/.gitignore  |    3 +++
 4 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/bootstrap.conf b/bootstrap.conf
index a460c57..62f03b7 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -35,6 +35,7 @@ gitlog-to-changelog
 git-version-gen
 hash
 ignore-value
+largefile
 lchmod
 lstat
 maintainer-makefile
diff --git a/configure.ac b/configure.ac
index aa07fac..08aa9ed 100644
--- a/configure.ac
+++ b/configure.ac
@@ -42,7 +42,6 @@ AC_PROG_CC
 AC_PROG_CC_STDC
 gl_EARLY
 gl_USE_SYSTEM_EXTENSIONS
-AC_SYS_LARGEFILE
 AC_HEADER_STDC
 gl_INIT

diff --git a/gnulib b/gnulib
index ef05ce6..5b9e0c3 160000
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit ef05ce61b0e5354256e0096c7dc022bf09bbf1d3
+Subproject commit 5b9e0c3ce734b9d9b0c0001e31b65a8a4713700d
diff --git a/m4/.gitignore b/m4/.gitignore
index 29db97d..a9814e0 100644
--- a/m4/.gitignore
+++ b/m4/.gitignore
@@ -37,6 +37,7 @@
 /inline.m4
 /intmax_t.m4
 /inttypes_h.m4
+/largefile.m4
 /lchmod.m4
 /localcharset.m4
 /locale-fr.m4
@@ -56,6 +57,7 @@
 /mktime.m4
 /mmap-anon.m4
 /multiarch.m4
+/nocrash.m4
 /parse-datetime.m4
 /pathmax.m4
 /printf.m4
@@ -85,6 +87,7 @@
 /strndup.m4
 /strnlen.m4
 /symlink.m4
+/sys_socket_h.m4
 /sys_stat_h.m4
 /sys_time_h.m4
 /tempname.m4
--
1.7.6.433.g1421f


From MAILER-DAEMON Wed Aug 10 18:27:56 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QrHFk-000354-FQ
	for mharc-bug-patch@gnu.org; Wed, 10 Aug 2011 18:27:56 -0400
Received: from eggs.gnu.org ([140.186.70.92]:49226)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <andreas.gruenbacher@gmail.com>) id 1QrHFh-00034r-WD
	for bug-patch@gnu.org; Wed, 10 Aug 2011 18:27:54 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <andreas.gruenbacher@gmail.com>) id 1QrHFf-00065o-R9
	for bug-patch@gnu.org; Wed, 10 Aug 2011 18:27:53 -0400
Received: from mail-fx0-f41.google.com ([209.85.161.41]:59758)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <andreas.gruenbacher@gmail.com>) id 1QrHFf-000654-L2
	for bug-patch@gnu.org; Wed, 10 Aug 2011 18:27:51 -0400
Received: by fxg9 with SMTP id 9so1579468fxg.0
	for <bug-patch@gnu.org>; Wed, 10 Aug 2011 15:27:50 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=subject:from:to:cc:date:in-reply-to:references:content-type
	:x-mailer:content-transfer-encoding:message-id:mime-version;
	bh=RCNkODkqEqTnBdl32K0sjHBVvHlRx+oTNgPQ5lPCHzg=;
	b=ftZVd7Ve/YmcivVvsCUdUD2mjNiWkKstFC9GNl7lefxUQuyGlpBFGOha45L0aDzM1n
	XV3jnR2n3eWb651AJcK7saxUvI1lIPixgzYRwenDPhGpxrrIA3xfqfyJ1hlnDDr0MnhK
	Q6yBWJ9Dqm++AkS1J4eUXwumRDorDFQpLE/8Q=
Received: by 10.223.76.202 with SMTP id d10mr11952832fak.106.1313015270144;
	Wed, 10 Aug 2011 15:27:50 -0700 (PDT)
Received: from [192.168.91.241] (chello084114015216.14.vie.surfer.at
	[84.114.15.216])
	by mx.google.com with ESMTPS id b14sm1066989fab.19.2011.08.10.15.27.48
	(version=SSLv3 cipher=OTHER); Wed, 10 Aug 2011 15:27:48 -0700 (PDT)
From: Andreas Gruenbacher <andreas.gruenbacher@gmail.com>
To: Jim Meyering <jim@meyering.net>
Date: Thu, 11 Aug 2011 00:27:47 +0200
In-Reply-To: <87ei0t48qe.fsf@rho.meyering.net>
References: <87ei0t48qe.fsf@rho.meyering.net>
Content-Type: text/plain; charset="UTF-8"
X-Mailer: Evolution 3.0.2 (3.0.2-3.fc15) 
Content-Transfer-Encoding: 7bit
Message-ID: <1313015268.14658.3.camel@schurl.linbit>
Mime-Version: 1.0
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 209.85.161.41
Cc: bug-patch@gnu.org
Subject: Re: [bug-patch] [PATCH 1/2] build: include .version in tarball to
 avoid distcheck failure
X-BeenThere: bug-patch@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports, suggestions,
	general discussion for GNU patch." <bug-patch.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-patch>,
	<mailto:bug-patch-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-patch>
List-Post: <mailto:bug-patch@gnu.org>
List-Help: <mailto:bug-patch-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-patch>,
	<mailto:bug-patch-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 10 Aug 2011 22:27:54 -0000

Jim,

On Wed, 2011-08-10 at 16:55 +0200, Jim Meyering wrote:
> Here are two patches:
> 
> The first prevents make distcheck failure,
> and the second helps Mac OS 10.5 users who use patch
> to operate on very large files.

both patches look reasonable.

Can you add .tarball-version to .gitignore as well as suggested in
build-aux/git-version-gen?

Thanks,
Andreas



From MAILER-DAEMON Thu Aug 11 08:20:38 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QrUFa-0000u3-LU
	for mharc-bug-patch@gnu.org; Thu, 11 Aug 2011 08:20:38 -0400
Received: from eggs.gnu.org ([140.186.70.92]:45778)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QrUFU-0000tE-MV
	for bug-patch@gnu.org; Thu, 11 Aug 2011 08:20:36 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QrUFQ-0005kC-Nb
	for bug-patch@gnu.org; Thu, 11 Aug 2011 08:20:32 -0400
Received: from mx.meyering.net ([82.230.74.64]:43449)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QrUFQ-0005k8-I7
	for bug-patch@gnu.org; Thu, 11 Aug 2011 08:20:28 -0400
Received: from rho.meyering.net (localhost.localdomain [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id 9903260237;
	Thu, 11 Aug 2011 14:20:27 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: Andreas Gruenbacher <andreas.gruenbacher@gmail.com>
In-Reply-To: <1313015268.14658.3.camel@schurl.linbit> (Andreas Gruenbacher's
	message of "Thu, 11 Aug 2011 00:27:47 +0200")
References: <87ei0t48qe.fsf@rho.meyering.net>
	<1313015268.14658.3.camel@schurl.linbit>
Date: Thu, 11 Aug 2011 14:20:27 +0200
Message-ID: <87y5z016no.fsf@rho.meyering.net>
Lines: 30
MIME-Version: 1.0
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 82.230.74.64
Cc: bug-patch@gnu.org
Subject: Re: [bug-patch] [PATCH 1/2] build: include .version in tarball to
	avoid distcheck failure
X-BeenThere: bug-patch@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports, suggestions,
	general discussion for GNU patch." <bug-patch.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-patch>,
	<mailto:bug-patch-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-patch>
List-Post: <mailto:bug-patch@gnu.org>
List-Help: <mailto:bug-patch-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-patch>,
	<mailto:bug-patch-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 11 Aug 2011 12:20:36 -0000

Andreas Gruenbacher wrote:
> On Wed, 2011-08-10 at 16:55 +0200, Jim Meyering wrote:
>> Here are two patches:
>>
>> The first prevents make distcheck failure,
>> and the second helps Mac OS 10.5 users who use patch
>> to operate on very large files.
>
> both patches look reasonable.

Thanks for the review.  Pushed.

> Can you add .tarball-version to .gitignore as well as suggested in
> build-aux/git-version-gen?

For reference, here is the comment:

    # It is probably wise to add these two files to .gitignore, so that you
    # don't accidentally commit either generated file.

That comment is borderline erroneous.
It gives good advice wrt .version, but not for .tarball-version.
I've just corrected it in gnulib:

   http://git.sv.gnu.org/cgit/gnulib.git/commit/?id=17857d41b41e7b2

Because .tarball-version is never generated in a git-controlled
directory, there is no risk that it would be accidentally VC-added.
And anyone who VC-adds the contents of a distribution tarball
will end up with a lot more to regret than one extra dot file.


From MAILER-DAEMON Thu Aug 11 08:54:25 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QrUmH-0005Ux-TF
	for mharc-bug-patch@gnu.org; Thu, 11 Aug 2011 08:54:25 -0400
Received: from eggs.gnu.org ([140.186.70.92]:52854)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <andreas.gruenbacher@gmail.com>) id 1QrUmC-0005UA-D7
	for bug-patch@gnu.org; Thu, 11 Aug 2011 08:54:24 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <andreas.gruenbacher@gmail.com>) id 1QrUm8-0003rN-AJ
	for bug-patch@gnu.org; Thu, 11 Aug 2011 08:54:20 -0400
Received: from mail-fx0-f41.google.com ([209.85.161.41]:47882)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <andreas.gruenbacher@gmail.com>) id 1QrUm8-0003qr-55
	for bug-patch@gnu.org; Thu, 11 Aug 2011 08:54:16 -0400
Received: by fxg9 with SMTP id 9so1973293fxg.0
	for <bug-patch@gnu.org>; Thu, 11 Aug 2011 05:54:15 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=from:to:subject:date:user-agent:cc:references:in-reply-to
	:mime-version:content-type:content-transfer-encoding:message-id;
	bh=38P8s1OwOkxj0hxhgps41nNCSYnPW/Nquv4LUEVkqf4=;
	b=WqVXOpLvQ8zUwcGtuDAy96hnTl/WYFWlPqxmLjfbuYr0cnqalpHWss1CdLPc6pnk1i
	hjvmh5zdp7D73gZwAmAN51Tsv58TM3YvY3Y2/S9FrltaQkchqyVdNfcu038VlPU5tjTI
	z2iBYTuLrh5MS/3MCc9fL+lXAnLF0vIZREzAs=
Received: by 10.223.15.13 with SMTP id i13mr13004597faa.51.1313067254953;
	Thu, 11 Aug 2011 05:54:14 -0700 (PDT)
Received: from murkel.localnet ([86.59.100.100])
	by mx.google.com with ESMTPS id p3sm1547270faa.9.2011.08.11.05.54.13
	(version=TLSv1/SSLv3 cipher=OTHER);
	Thu, 11 Aug 2011 05:54:13 -0700 (PDT)
From: Andreas Gruenbacher <andreas.gruenbacher@gmail.com>
To: Jim Meyering <jim@meyering.net>
Date: Thu, 11 Aug 2011 14:54:11 +0200
User-Agent: KMail/1.12.4 (Linux/2.6.36-rc7+; KDE/4.3.5; i686; ; )
References: <87ei0t48qe.fsf@rho.meyering.net>
	<1313015268.14658.3.camel@schurl.linbit>
	<87y5z016no.fsf@rho.meyering.net>
In-Reply-To: <87y5z016no.fsf@rho.meyering.net>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="iso-8859-15"
Content-Transfer-Encoding: 7bit
Message-Id: <201108111454.11322.andreas.gruenbacher@gmail.com>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 209.85.161.41
Cc: bug-patch@gnu.org
Subject: Re: [bug-patch] [PATCH 1/2] build: include .version in tarball to
	avoid distcheck failure
X-BeenThere: bug-patch@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports, suggestions,
	general discussion for GNU patch." <bug-patch.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-patch>,
	<mailto:bug-patch-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-patch>
List-Post: <mailto:bug-patch@gnu.org>
List-Help: <mailto:bug-patch-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-patch>,
	<mailto:bug-patch-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 11 Aug 2011 12:54:24 -0000

On Thursday 11 August 2011 14:20:27 Jim Meyering wrote:
> Because .tarball-version is never generated in a git-controlled
> directory, there is no risk that it would be accidentally VC-added.
> And anyone who VC-adds the contents of a distribution tarball
> will end up with a lot more to regret than one extra dot file.

Ah, that makes sense.

Thanks,
Andreas


From MAILER-DAEMON Mon Aug 15 19:17:04 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Qt6P2-0001rh-NZ
	for mharc-bug-patch@gnu.org; Mon, 15 Aug 2011 19:17:04 -0400
Received: from eggs.gnu.org ([140.186.70.92]:36688)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1Qt6Oz-0001rE-Ej
	for bug-patch@gnu.org; Mon, 15 Aug 2011 19:17:03 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1Qt6Oy-0002gX-6R
	for bug-patch@gnu.org; Mon, 15 Aug 2011 19:17:01 -0400
Received: from mx1.redhat.com ([209.132.183.28]:27618)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1Qt6Ox-0002gS-Rm
	for bug-patch@gnu.org; Mon, 15 Aug 2011 19:17:00 -0400
Received: from int-mx01.intmail.prod.int.phx2.redhat.com
	(int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p7FNGxsv008621
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 15 Aug 2011 19:16:59 -0400
Received: from [10.3.113.118] (ovpn-113-118.phx2.redhat.com [10.3.113.118])
	by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP
	id p7FNGwut003417; Mon, 15 Aug 2011 19:16:58 -0400
Message-ID: <4E49A8EA.5020507@redhat.com>
Date: Mon, 15 Aug 2011 17:16:58 -0600
From: Eric Blake <eblake@redhat.com>
Organization: Red Hat
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.2.18) Gecko/20110621 Fedora/3.1.11-1.fc14
	Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.11
MIME-Version: 1.0
To: bug-patch@gnu.org, Git Mailing List <git@vger.kernel.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
Subject: [bug-patch] rejecting patches that have an offset
X-BeenThere: bug-patch@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports, suggestions,
	general discussion for GNU patch." <bug-patch.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-patch>,
	<mailto:bug-patch-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-patch>
List-Post: <mailto:bug-patch@gnu.org>
List-Help: <mailto:bug-patch-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-patch>,
	<mailto:bug-patch-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 15 Aug 2011 23:17:03 -0000

I ran into a case that cost me several hours today, while building an 
rpm file for libvirt.  I have a context patch that only adds lines (no 
deletions), and which had multiple places in the destination file where 
the patch would match context and still apply, although only one of 
those places will compile as correct.  However, the patch file was 
inadvertently generated by git against the wrong version of the 
destination, so the line numbers in the patch did not match the version 
of the file that I was trying to apply it to, and 'patch -p1 --fuzz=0 
-s' ended up triggering patch's sliding algorithm where it applied the 
patch with an offset of 11 lines.  Meanwhile, running the same patch 
through git applied the patch in a different offset: git found the 
offset that matched the function name in the @@ line, which was more 
than 11 lines away, but actually matched the intent of the patch better.

The problem is that the difference in choice between patch and git 
resulted in a patch series that works or fails according to which tool 
you pass it through.  But the whole point of an rpm file is that if the 
patches were generated correctly, none of them should ever have any 
offset - an rpm should be tool-independent.

It would have saved me a lot of time if both 'patch' and 'git apply' 
could be taught a mode of operation where they explicitly reject a patch 
that cannot be applied without relying on an offset.  That is, 'patch 
--fuzz=0' is too weak, and the fact that 'patch -s' squelched the error 
message meant that I had nothing to alert me to the fact that an offset 
even took place.  And no, I don't want to filterdiff from patchutils to 
convert the patch from context-diff over to ed-script-diff just to 
benefit from the fact that patch does not do offset detection on 
ed-script-patches.

If it were possible to optionally reject patches with offsets, then 
building rpm files could use this mode to insist that all patches apply 
offset-free, making for a more robust patch chain (of course, the 
default should remain that the offset algorithm is still applied, and 
only suppressed by explicit request, as the use of offsets is normally a 
very useful feature - my point is that rpm patch chains are an exception 
for the rule where offsets normally make life easier).

It might also be nice if patch could learn the algorithm that appears to 
match the git behavior, where when there are multiple points with 
identical context (viewing just the context in isolation), but where 
those locations differ in function location (as learned by the @@ header 
line in the patch file), then the preferred offset is the one in the 
named function, even if that is not the closes context match to the line 
number given in the patch file.

-- 
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org


From MAILER-DAEMON Tue Aug 16 18:48:16 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QtSQi-0000mO-Ku
	for mharc-bug-patch@gnu.org; Tue, 16 Aug 2011 18:48:16 -0400
Received: from eggs.gnu.org ([140.186.70.92]:52494)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <andreas.gruenbacher@gmail.com>) id 1QtSQf-0000la-T9
	for bug-patch@gnu.org; Tue, 16 Aug 2011 18:48:14 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <andreas.gruenbacher@gmail.com>) id 1QtSQe-0006O6-RS
	for bug-patch@gnu.org; Tue, 16 Aug 2011 18:48:13 -0400
Received: from mail-fx0-f41.google.com ([209.85.161.41]:49897)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <andreas.gruenbacher@gmail.com>) id 1QtSQe-0006O1-IA
	for bug-patch@gnu.org; Tue, 16 Aug 2011 18:48:12 -0400
Received: by fxg9 with SMTP id 9so375628fxg.0
	for <bug-patch@gnu.org>; Tue, 16 Aug 2011 15:48:11 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=subject:from:to:cc:date:in-reply-to:references:content-type
	:x-mailer:content-transfer-encoding:message-id:mime-version;
	bh=7/bnWVCcOMvyLEwIL7yB9kd3D9xpWR6nCXr6rZhnoho=;
	b=aJG0MyJttEWkZvPo700rG5hZJerAC/VZFVz/gV0L75xG2nujqVnCNiDnkc7TGS/WNp
	Lk5R9j/2cywBYf1nPrLEDSERtF4gMBhzOPb8ad0gL4y/7JEXha1Rm7BfRTktIA292H9D
	pGo5F04ODNJ6GnsfQhXmLyaCrcPN/1NrgZlFA=
Received: by 10.223.105.134 with SMTP id t6mr351711fao.81.1313534890991;
	Tue, 16 Aug 2011 15:48:10 -0700 (PDT)
Received: from [192.168.91.241] (chello084114015216.14.vie.surfer.at
	[84.114.15.216])
	by mx.google.com with ESMTPS id s14sm402323fah.29.2011.08.16.15.48.07
	(version=SSLv3 cipher=OTHER); Tue, 16 Aug 2011 15:48:09 -0700 (PDT)
From: Andreas Gruenbacher <andreas.gruenbacher@gmail.com>
To: Eric Blake <eblake@redhat.com>
Date: Wed, 17 Aug 2011 00:48:07 +0200
In-Reply-To: <4E49A8EA.5020507@redhat.com>
References: <4E49A8EA.5020507@redhat.com>
Content-Type: text/plain; charset="UTF-8"
X-Mailer: Evolution 3.0.2 (3.0.2-3.fc15) 
Content-Transfer-Encoding: 7bit
Message-ID: <1313534889.5598.21.camel@schurl.linbit>
Mime-Version: 1.0
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 209.85.161.41
Cc: bug-patch@gnu.org, Git Mailing List <git@vger.kernel.org>
Subject: Re: [bug-patch] rejecting patches that have an offset
X-BeenThere: bug-patch@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports, suggestions,
	general discussion for GNU patch." <bug-patch.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-patch>,
	<mailto:bug-patch-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-patch>
List-Post: <mailto:bug-patch@gnu.org>
List-Help: <mailto:bug-patch-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-patch>,
	<mailto:bug-patch-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 16 Aug 2011 22:48:14 -0000

Eric,

On Mon, 2011-08-15 at 17:16 -0600, Eric Blake wrote:
> It would have saved me a lot of time if both 'patch' and 'git apply' 
> could be taught a mode of operation where they explicitly reject a patch 
> that cannot be applied without relying on an offset.

that sounds reasonable.  Can you send a patch or at least add a bug on
Savannah?

> It might also be nice if patch could learn the algorithm that appears to 
> match the git behavior, where when there are multiple points with 
> identical context (viewing just the context in isolation), but where 
> those locations differ in function location (as learned by the @@ header 
> line in the patch file), then the preferred offset is the one in the 
> named function, even if that is not the closes context match to the line 
> number given in the patch file.

Sounds interesting; a patch for that would be great as well.

Thanks,
Andreas



From MAILER-DAEMON Tue Aug 16 19:10:53 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QtSmb-00048q-Bv
	for mharc-bug-patch@gnu.org; Tue, 16 Aug 2011 19:10:53 -0400
Received: from eggs.gnu.org ([140.186.70.92]:58264)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QtSmX-00047z-6x
	for bug-patch@gnu.org; Tue, 16 Aug 2011 19:10:50 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QtSmW-0001HA-2j
	for bug-patch@gnu.org; Tue, 16 Aug 2011 19:10:49 -0400
Received: from mx1.redhat.com ([209.132.183.28]:9089)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QtSmV-0001Gy-Rq
	for bug-patch@gnu.org; Tue, 16 Aug 2011 19:10:48 -0400
Received: from int-mx09.intmail.prod.int.phx2.redhat.com
	(int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p7GNAjl0015036
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 16 Aug 2011 19:10:45 -0400
Received: from [10.3.113.118] (ovpn-113-118.phx2.redhat.com [10.3.113.118])
	by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id p7GNAimS030880; Tue, 16 Aug 2011 19:10:45 -0400
Message-ID: <4E4AF8F4.60709@redhat.com>
Date: Tue, 16 Aug 2011 17:10:44 -0600
From: Eric Blake <eblake@redhat.com>
Organization: Red Hat
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.2.18) Gecko/20110621 Fedora/3.1.11-1.fc14
	Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.11
MIME-Version: 1.0
To: Andreas Gruenbacher <andreas.gruenbacher@gmail.com>
References: <4E49A8EA.5020507@redhat.com>
	<1313534889.5598.21.camel@schurl.linbit>
In-Reply-To: <1313534889.5598.21.camel@schurl.linbit>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
Cc: bug-patch@gnu.org, Git Mailing List <git@vger.kernel.org>
Subject: Re: [bug-patch] rejecting patches that have an offset
X-BeenThere: bug-patch@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports, suggestions,
	general discussion for GNU patch." <bug-patch.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-patch>,
	<mailto:bug-patch-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-patch>
List-Post: <mailto:bug-patch@gnu.org>
List-Help: <mailto:bug-patch-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-patch>,
	<mailto:bug-patch-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 16 Aug 2011 23:10:50 -0000

On 08/16/2011 04:48 PM, Andreas Gruenbacher wrote:
> Eric,
>
> On Mon, 2011-08-15 at 17:16 -0600, Eric Blake wrote:
>> It would have saved me a lot of time if both 'patch' and 'git apply'
>> could be taught a mode of operation where they explicitly reject a patch
>> that cannot be applied without relying on an offset.
>
> that sounds reasonable.  Can you send a patch or at least add a bug on
> Savannah?

Bug opened: https://savannah.gnu.org/bugs/index.php?34031

>
>> It might also be nice if patch could learn the algorithm that appears to
>> match the git behavior, where when there are multiple points with
>> identical context (viewing just the context in isolation), but where
>> those locations differ in function location (as learned by the @@ header
>> line in the patch file), then the preferred offset is the one in the
>> named function, even if that is not the closes context match to the line
>> number given in the patch file.
>
> Sounds interesting; a patch for that would be great as well.

Bug opened: https://savannah.gnu.org/bugs/index.php?34032

-- 
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org


From MAILER-DAEMON Tue Aug 16 19:41:41 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QtTGP-0000Np-NR
	for mharc-bug-patch@gnu.org; Tue, 16 Aug 2011 19:41:41 -0400
Received: from eggs.gnu.org ([140.186.70.92]:33270)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QtTGN-0000Mv-JI
	for bug-patch@gnu.org; Tue, 16 Aug 2011 19:41:40 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QtTGM-0006tX-5P
	for bug-patch@gnu.org; Tue, 16 Aug 2011 19:41:39 -0400
Received: from mx1.redhat.com ([209.132.183.28]:11315)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QtTGL-0006tK-Ru
	for bug-patch@gnu.org; Tue, 16 Aug 2011 19:41:38 -0400
Received: from int-mx01.intmail.prod.int.phx2.redhat.com
	(int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p7GNfafA018480
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 16 Aug 2011 19:41:36 -0400
Received: from [10.3.113.118] (ovpn-113-118.phx2.redhat.com [10.3.113.118])
	by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP
	id p7GNfZHw019345; Tue, 16 Aug 2011 19:41:36 -0400
Message-ID: <4E4B002A.8020207@redhat.com>
Date: Tue, 16 Aug 2011 17:41:30 -0600
From: Eric Blake <eblake@redhat.com>
Organization: Red Hat
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.2.18) Gecko/20110621 Fedora/3.1.11-1.fc14
	Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.11
MIME-Version: 1.0
To: Junio C Hamano <gitster@pobox.com>
References: <4E49A8EA.5020507@redhat.com>
	<7vobzpeybh.fsf@alter.siamese.dyndns.org>
In-Reply-To: <7vobzpeybh.fsf@alter.siamese.dyndns.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
Cc: bug-patch@gnu.org, Git Mailing List <git@vger.kernel.org>
Subject: Re: [bug-patch] rejecting patches that have an offset
X-BeenThere: bug-patch@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports, suggestions,
	general discussion for GNU patch." <bug-patch.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-patch>,
	<mailto:bug-patch-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-patch>
List-Post: <mailto:bug-patch@gnu.org>
List-Help: <mailto:bug-patch-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-patch>,
	<mailto:bug-patch-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 16 Aug 2011 23:41:40 -0000

On 08/16/2011 05:22 PM, Junio C Hamano wrote:
> Eric Blake<eblake@redhat.com>  writes:
>
>> It would have saved me a lot of time if both 'patch' and 'git apply'
>> could be taught a mode of operation where they explicitly reject a
>> patch that cannot be applied without relying on an offset.
>
> I am not sure about this. I somehow doubt you would want to make sure that
> the preimage your patch is to be applied must be bit-for-bit identical to
> what you prepared your patch for, IOW, you are using a patchfile merely as
> a mean to "compress" the replacement file. You would want your RPM change
> to tolerate some changes in the upstream and keep your patch applicable to
> the next version of the upstream, no?

When the RPM file is generated by git->patchfile list conversion, and I 
am trying to recreate a git repository from patchfile list->git, then 
yes, I _do_ want that patchfile list to apply bit-for-bit identical to 
anyone else starting from the same point, whether they use git or patch, 
so that anyone else can regenerate the end sources that were compiled 
into the rpm release.

Remember, the rpm file format includes both the starting point (it 
documents the upstream tarball) and the changes to that starting point 
(a patch stream) that were used to create a given released binary, in a 
format that is independent of git.  The idea is that managing an rpm 
patch series in git is much nicer for day-to-day work (and daily work 
within that git repository greatly benefits from the default of being 
able to assume patch offsets, such as rebasing a patch series to apply 
on top of newer upstream versions), but once converting from git out to 
rpm, the conversion from rpm back to git should give a bit-for-bit 
replay.  If heuristics for how to apply patch offsets change, and an rpm 
file includes an ambiguous patch that requires an offset, then you risk 
the rpm file being broken the moment you upgrade to a newer tool chain 
with a slightly different heuristic for where to resolve offsets; but if 
all patches in the series are 0-offset, then you have isolated the rpm 
from any implicit dependency on the version of the tool used to 
reconstruct the final software from the patch series.  So the question 
is now how to identify whether a patch series meets that 0-offset rule, 
and that's where a new option would be handy.

Hence, I'm requesting an option to reject patches with non-zero offsets, 
but not making it default, as there are only a few limited places (such 
as rebuilding a git repo starting from an rpm patch list) where 
bit-for-bit rebuild is more desirable than accounting for offsets due to 
changes in the starting point.

>
> Given a patch that is not precise and can apply to multiple places,
> "patch" and/or "git apply" can apply it to a place you may not have
> intended. It may feel like a bug if that happens to a preimage that is
> bit-for-bit identical to the version you prepared your patch is against,
> but I would rather think, instead of blaming "patch" and/or "git apply",
> it would be more productive to prepare a patch with larger context when
> you know that the preimage file you are patching has many similar looking
> lines, to make it _impossible_ for it to apply to places different from
> what you intended.

Yes, I know that as well - the particular patch that sparked this thread 
was ambiguous with three lines of context, but unambiguous with 6 lines, 
even when an offset still had to be applied.

So maybe you raise yet another feature proposal: What would it take for 
git to generate unambiguous patches - that is, when generating a patch 
with context, to then ensure that given the file it is being applied to, 
then context is auto-widened until there are no other offsets where the 
patch can possibly be applied?  In other words, if I say 'git diff HEAD^ 
--auto-context', then the resulting patch would have automatically have 
6 context lines for my problematic hunk, while sticking to the default 3 
context lines for other hunks that were already unambiguous.  Of course, 
this only protects you if starting from the same version of the file 
(since any other patch can introduce an ambiguity not present at the 
time you computed the minimal context needed for non-ambiguity in your 
version of the pre-patch file).

-- 
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org


From MAILER-DAEMON Wed Aug 17 09:01:10 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Qtfk6-0005wh-Oz
	for mharc-bug-patch@gnu.org; Wed, 17 Aug 2011 09:01:10 -0400
Received: from eggs.gnu.org ([140.186.70.92]:42356)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <junio@b-sasl-quonix.pobox.com>) id 1QtTac-0002nj-Pd
	for bug-patch@gnu.org; Tue, 16 Aug 2011 20:02:35 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <junio@b-sasl-quonix.pobox.com>) id 1QtTab-0001qY-Ij
	for bug-patch@gnu.org; Tue, 16 Aug 2011 20:02:34 -0400
Received: from b-pb-sasl-quonix.pobox.com ([208.72.237.35]:34757
	helo=smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <junio@b-sasl-quonix.pobox.com>) id 1QtTab-0001qR-Br
	for bug-patch@gnu.org; Tue, 16 Aug 2011 20:02:33 -0400
Received: from smtp.pobox.com (unknown [127.0.0.1])
	by b-sasl-quonix.pobox.com (Postfix) with ESMTP id D13A65AF0;
	Tue, 16 Aug 2011 19:22:44 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc
	:subject:references:date:in-reply-to:message-id:mime-version
	:content-type; s=sasl; bh=cIINGkc34dBsyDR6OauY2aelkzo=; b=ahSNX5
	ccCsdVUF96iaYFSdGiTOKeIW05ZauDTJ9oOKS48g7USMIx9hFwR7cYRpBQaLrl7W
	vNLwiVTSPq9/VxrihUd49gqzYEfaHVpM3z1A6bERhVRcXDmaI/WYA4jZx1ISNqNB
	ebeF4QD3cJA+GTNlXaSx8mJxW94QUdzF3PSmk=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc
	:subject:references:date:in-reply-to:message-id:mime-version
	:content-type; q=dns; s=sasl; b=sEd9jotkFfILucvz0scV85BgWC4uGNq9
	4oPJOq4OLGLpHUeCmpG7XB1pVxcMPt0C9ErSDqxEwWpJkn8usjQe9kEFsFiYLBG0
	Uabi2BCkbY+Op0zGHo/eR6/8A4FCDR5HrCK+WbFNkMJ1RaaEkAvolkDX+qhyFpFm
	HwvyJqP1HZU=
Received: from b-pb-sasl-quonix.pobox.com (unknown [127.0.0.1])
	by b-sasl-quonix.pobox.com (Postfix) with ESMTP id C6E0D5AEF;
	Tue, 16 Aug 2011 19:22:44 -0400 (EDT)
Received: from pobox.com (unknown [76.102.170.102]) (using TLSv1 with cipher
	DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by
	b-sasl-quonix.pobox.com (Postfix) with ESMTPSA id 596335AEE;
	Tue, 16 Aug 2011 19:22:44 -0400 (EDT)
From: Junio C Hamano <gitster@pobox.com>
To: Eric Blake <eblake@redhat.com>
References: <4E49A8EA.5020507@redhat.com>
Date: Tue, 16 Aug 2011 16:22:42 -0700
In-Reply-To: <4E49A8EA.5020507@redhat.com> (Eric Blake's message of "Mon, 15
	Aug 2011 17:16:58 -0600")
Message-ID: <7vobzpeybh.fsf@alter.siamese.dyndns.org>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Pobox-Relay-ID: A51E9F52-C85E-11E0-A6AD-1DC62E706CDE-77302942!b-pb-sasl-quonix.pobox.com
X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta)
X-Received-From: 208.72.237.35
X-Mailman-Approved-At: Wed, 17 Aug 2011 09:01:09 -0400
Cc: bug-patch@gnu.org, Git Mailing List <git@vger.kernel.org>
Subject: Re: [bug-patch] rejecting patches that have an offset
X-BeenThere: bug-patch@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports, suggestions,
	general discussion for GNU patch." <bug-patch.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-patch>,
	<mailto:bug-patch-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-patch>
List-Post: <mailto:bug-patch@gnu.org>
List-Help: <mailto:bug-patch-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-patch>,
	<mailto:bug-patch-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 17 Aug 2011 00:02:35 -0000

Eric Blake <eblake@redhat.com> writes:

> It would have saved me a lot of time if both 'patch' and 'git apply'
> could be taught a mode of operation where they explicitly reject a
> patch that cannot be applied without relying on an offset.

I am not sure about this. I somehow doubt you would want to make sure that
the preimage your patch is to be applied must be bit-for-bit identical to
what you prepared your patch for, IOW, you are using a patchfile merely as
a mean to "compress" the replacement file. You would want your RPM change
to tolerate some changes in the upstream and keep your patch applicable to
the next version of the upstream, no?

Given a patch that is not precise and can apply to multiple places,
"patch" and/or "git apply" can apply it to a place you may not have
intended. It may feel like a bug if that happens to a preimage that is
bit-for-bit identical to the version you prepared your patch is against,
but I would rather think, instead of blaming "patch" and/or "git apply",
it would be more productive to prepare a patch with larger context when
you know that the preimage file you are patching has many similar looking
lines, to make it _impossible_ for it to apply to places different from
what you intended.


From MAILER-DAEMON Sat Aug 20 19:14:24 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QuukC-0000yM-I5
	for mharc-bug-patch@gnu.org; Sat, 20 Aug 2011 19:14:24 -0400
Received: from eggs.gnu.org ([140.186.70.92]:51377)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <beebe@math.utah.edu>) id 1Quuk9-0000xb-OW
	for bug-patch@gnu.org; Sat, 20 Aug 2011 19:14:22 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <beebe@math.utah.edu>) id 1Quuk8-0003zy-GU
	for bug-patch@gnu.org; Sat, 20 Aug 2011 19:14:21 -0400
Received: from mail.math.utah.edu ([155.101.98.135]:44595)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <beebe@math.utah.edu>) id 1Quuk8-0003zs-Ab
	for bug-patch@gnu.org; Sat, 20 Aug 2011 19:14:20 -0400
Received: from psi.math.utah.edu (psi.math.utah.edu [155.101.96.19])
	by mail.math.utah.edu (8.14.4/8.14.4) with ESMTP id p7KNEJpZ005839;
	Sat, 20 Aug 2011 17:14:19 -0600 (MDT)
Received: from psi.math.utah.edu (localhost [127.0.0.1])
	by psi.math.utah.edu (8.14.4/8.14.4) with ESMTP id p7KNEJ09000619;
	Sat, 20 Aug 2011 17:14:19 -0600 (MDT)
Received: (from beebe@localhost)
	by psi.math.utah.edu (8.14.4/8.14.4/Submit) id p7KNEJqt000618;
	Sat, 20 Aug 2011 17:14:19 -0600 (MDT)
Date: Sat, 20 Aug 2011 17:14:19 -0600 (MDT)
From: "Nelson H. F. Beebe" <beebe@math.utah.edu>
To: bug-patch@gnu.org
X-US-Mail: "Department of Mathematics, 110 LCB, University of Utah, 155 S
	1400 E RM 233, Salt Lake City, UT 84112-0090, USA"
X-Telephone: +1 801 581 5254
X-FAX: +1 801 585 1640, +1 801 581 4148
X-URL: http://www.math.utah.edu/~beebe
Message-ID: <CMM.0.95.0.1313882059.beebe@psi.math.utah.edu>
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8
	(mail.math.utah.edu [155.101.98.135]);
	Sat, 20 Aug 2011 17:14:19 -0600 (MDT)
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 155.101.98.135
Cc: beebe@math.utah.edu
Subject: [bug-patch] patch-2.6.1.136-31a7 test suite failures: diagnosis for
 FreeBSD 8.2
X-BeenThere: bug-patch@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports, suggestions,
	general discussion for GNU patch." <bug-patch.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-patch>,
	<mailto:bug-patch-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-patch>
List-Post: <mailto:bug-patch@gnu.org>
List-Help: <mailto:bug-patch-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-patch>,
	<mailto:bug-patch-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 20 Aug 2011 23:14:22 -0000

The FreeBSD 8.2 tests/*.log files for patch-2.6.1.136-31a7 all have
something like this one:

% cat unmodified-files.log
FAIL: unmodified-files (exit: 2)
================================

eval: ${BASH_LINENO[...}: Bad substitution

I therefore tried this:

% make clean
% ksh
$ make SHELL=/usr/local/bin/ksh all check
...
FAIL: crlf-handling
FAIL: merge
2 of 31 tests failed

Those remaining failures have already been reported for
other BSD flavors.

-------------------------------------------------------------------------------
- Nelson H. F. Beebe                    Tel: +1 801 581 5254                  -
- University of Utah                    FAX: +1 801 581 4148                  -
- Department of Mathematics, 110 LCB    Internet e-mail: beebe@math.utah.edu  -
- 155 S 1400 E RM 233                       beebe@acm.org  beebe@computer.org -
- Salt Lake City, UT 84112-0090, USA    URL: http://www.math.utah.edu/~beebe/ -
-------------------------------------------------------------------------------


From MAILER-DAEMON Sat Aug 20 19:20:15 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Quupr-0002dY-6H
	for mharc-bug-patch@gnu.org; Sat, 20 Aug 2011 19:20:15 -0400
Received: from eggs.gnu.org ([140.186.70.92]:45834)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <beebe@math.utah.edu>) id 1Quupp-0002bq-9k
	for bug-patch@gnu.org; Sat, 20 Aug 2011 19:20:14 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <beebe@math.utah.edu>) id 1Quupn-0005GH-C7
	for bug-patch@gnu.org; Sat, 20 Aug 2011 19:20:13 -0400
Received: from mail.math.utah.edu ([155.101.98.135]:44867)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <beebe@math.utah.edu>) id 1Quupm-0005Fi-Uu
	for bug-patch@gnu.org; Sat, 20 Aug 2011 19:20:11 -0400
Received: from psi.math.utah.edu (psi.math.utah.edu [155.101.96.19])
	by mail.math.utah.edu (8.14.4/8.14.4) with ESMTP id p7KMocX8005117;
	Sat, 20 Aug 2011 16:50:38 -0600 (MDT)
Received: from psi.math.utah.edu (localhost [127.0.0.1])
	by psi.math.utah.edu (8.14.4/8.14.4) with ESMTP id p7KMocFG000518;
	Sat, 20 Aug 2011 16:50:38 -0600 (MDT)
Received: (from beebe@localhost)
	by psi.math.utah.edu (8.14.4/8.14.4/Submit) id p7KMoc5p000516;
	Sat, 20 Aug 2011 16:50:38 -0600 (MDT)
Date: Sat, 20 Aug 2011 16:50:38 -0600 (MDT)
From: "Nelson H. F. Beebe" <beebe@math.utah.edu>
To: bug-patch@gnu.org
X-US-Mail: "Department of Mathematics, 110 LCB, University of Utah, 155 S
	1400 E RM 233, Salt Lake City, UT 84112-0090, USA"
X-Telephone: +1 801 581 5254
X-FAX: +1 801 585 1640, +1 801 581 4148
X-URL: http://www.math.utah.edu/~beebe
Message-ID: <CMM.0.95.0.1313880638.beebe@psi.math.utah.edu>
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8
	(mail.math.utah.edu [155.101.98.135]);
	Sat, 20 Aug 2011 16:50:38 -0600 (MDT)
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 155.101.98.135
Cc: beebe@math.utah.edu
Subject: [bug-patch] patch-2.6.1.136-31a7 compilation failures on Red Hat 5.6
X-BeenThere: bug-patch@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports, suggestions,
	general discussion for GNU patch." <bug-patch.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-patch>,
	<mailto:bug-patch-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-patch>
List-Post: <mailto:bug-patch@gnu.org>
List-Help: <mailto:bug-patch-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-patch>,
	<mailto:bug-patch-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 20 Aug 2011 23:20:14 -0000

patch-2.6.1.136-31a7 fails to compile on Red Hat 5.6
sytems (x86, x86_64, and IA-64): util.c gets this error:

  CC     util.o
util.c: In function `copy_attr_check':
util.c:161: warning: implicit declaration of function `attr_copy_action'
util.c:162: error: `ATTR_ACTION_PERMISSIONS' undeclared (first use in this function)
util.c:162: error: (Each undeclared identifier is reported only once
util.c:162: error: for each function it appears in.)

-------------------------------------------------------------------------------
- Nelson H. F. Beebe                    Tel: +1 801 581 5254                  -
- University of Utah                    FAX: +1 801 581 4148                  -
- Department of Mathematics, 110 LCB    Internet e-mail: beebe@math.utah.edu  -
- 155 S 1400 E RM 233                       beebe@acm.org  beebe@computer.org -
- Salt Lake City, UT 84112-0090, USA    URL: http://www.math.utah.edu/~beebe/ -
-------------------------------------------------------------------------------


From MAILER-DAEMON Sat Aug 20 19:20:18 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Quupu-0002ge-7t
	for mharc-bug-patch@gnu.org; Sat, 20 Aug 2011 19:20:18 -0400
Received: from eggs.gnu.org ([140.186.70.92]:45825)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <beebe@math.utah.edu>) id 1Quupo-0002bp-GK
	for bug-patch@gnu.org; Sat, 20 Aug 2011 19:20:14 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <beebe@math.utah.edu>) id 1Quupn-0005Fw-As
	for bug-patch@gnu.org; Sat, 20 Aug 2011 19:20:12 -0400
Received: from mail.math.utah.edu ([155.101.98.135]:44863)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <beebe@math.utah.edu>) id 1Quupm-0005Fe-Ux
	for bug-patch@gnu.org; Sat, 20 Aug 2011 19:20:11 -0400
Received: from psi.math.utah.edu (psi.math.utah.edu [155.101.96.19])
	by mail.math.utah.edu (8.14.4/8.14.4) with ESMTP id p7KMq9JR005167;
	Sat, 20 Aug 2011 16:52:09 -0600 (MDT)
Received: from psi.math.utah.edu (localhost [127.0.0.1])
	by psi.math.utah.edu (8.14.4/8.14.4) with ESMTP id p7KMq9TY000526;
	Sat, 20 Aug 2011 16:52:09 -0600 (MDT)
Received: (from beebe@localhost)
	by psi.math.utah.edu (8.14.4/8.14.4/Submit) id p7KMq9wg000525;
	Sat, 20 Aug 2011 16:52:09 -0600 (MDT)
Date: Sat, 20 Aug 2011 16:52:09 -0600 (MDT)
From: "Nelson H. F. Beebe" <beebe@math.utah.edu>
To: bug-patch@gnu.org
X-US-Mail: "Department of Mathematics, 110 LCB, University of Utah, 155 S
	1400 E RM 233, Salt Lake City, UT 84112-0090, USA"
X-Telephone: +1 801 581 5254
X-FAX: +1 801 585 1640, +1 801 581 4148
X-URL: http://www.math.utah.edu/~beebe
Message-ID: <CMM.0.95.0.1313880729.beebe@psi.math.utah.edu>
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8
	(mail.math.utah.edu [155.101.98.135]);
	Sat, 20 Aug 2011 16:52:09 -0600 (MDT)
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 155.101.98.135
Cc: beebe@math.utah.edu
Subject: [bug-patch] patch-2.6.1.136-31a7 compilation failures on Solaris 11
 Intel
X-BeenThere: bug-patch@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports, suggestions,
	general discussion for GNU patch." <bug-patch.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-patch>,
	<mailto:bug-patch-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-patch>
List-Post: <mailto:bug-patch@gnu.org>
List-Help: <mailto:bug-patch-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-patch>,
	<mailto:bug-patch-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 20 Aug 2011 23:20:15 -0000

patch-2.6.1.136-31a7 fails to compile on Solaris 11 Intel:

  CC     dup-safer.o
"dup-safer.c", line 33: undefined symbol: STDERR_FILENO

-------------------------------------------------------------------------------
- Nelson H. F. Beebe                    Tel: +1 801 581 5254                  -
- University of Utah                    FAX: +1 801 581 4148                  -
- Department of Mathematics, 110 LCB    Internet e-mail: beebe@math.utah.edu  -
- 155 S 1400 E RM 233                       beebe@acm.org  beebe@computer.org -
- Salt Lake City, UT 84112-0090, USA    URL: http://www.math.utah.edu/~beebe/ -
-------------------------------------------------------------------------------


From MAILER-DAEMON Sat Aug 20 19:20:18 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Quupu-0002gq-9G
	for mharc-bug-patch@gnu.org; Sat, 20 Aug 2011 19:20:18 -0400
Received: from eggs.gnu.org ([140.186.70.92]:45841)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <beebe@math.utah.edu>) id 1Quupq-0002ci-3k
	for bug-patch@gnu.org; Sat, 20 Aug 2011 19:20:14 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <beebe@math.utah.edu>) id 1Quupn-0005G8-BO
	for bug-patch@gnu.org; Sat, 20 Aug 2011 19:20:13 -0400
Received: from mail.math.utah.edu ([155.101.98.135]:44865)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <beebe@math.utah.edu>) id 1Quupm-0005Fg-V0
	for bug-patch@gnu.org; Sat, 20 Aug 2011 19:20:11 -0400
Received: from psi.math.utah.edu (psi.math.utah.edu [155.101.96.19])
	by mail.math.utah.edu (8.14.4/8.14.4) with ESMTP id p7KMvjNV005275;
	Sat, 20 Aug 2011 16:57:45 -0600 (MDT)
Received: from psi.math.utah.edu (localhost [127.0.0.1])
	by psi.math.utah.edu (8.14.4/8.14.4) with ESMTP id p7KMvjcq000534;
	Sat, 20 Aug 2011 16:57:45 -0600 (MDT)
Received: (from beebe@localhost)
	by psi.math.utah.edu (8.14.4/8.14.4/Submit) id p7KMvjWu000532;
	Sat, 20 Aug 2011 16:57:45 -0600 (MDT)
Date: Sat, 20 Aug 2011 16:57:45 -0600 (MDT)
From: "Nelson H. F. Beebe" <beebe@math.utah.edu>
To: bug-patch@gnu.org
X-US-Mail: "Department of Mathematics, 110 LCB, University of Utah, 155 S
	1400 E RM 233, Salt Lake City, UT 84112-0090, USA"
X-Telephone: +1 801 581 5254
X-FAX: +1 801 585 1640, +1 801 581 4148
X-URL: http://www.math.utah.edu/~beebe
Message-ID: <CMM.0.95.0.1313881065.beebe@psi.math.utah.edu>
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8
	(mail.math.utah.edu [155.101.98.135]);
	Sat, 20 Aug 2011 16:57:45 -0600 (MDT)
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 155.101.98.135
Cc: beebe@math.utah.edu
Subject: [bug-patch] patch-2.6.1.136-31a7 test suite failures on *BSD systems
X-BeenThere: bug-patch@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports, suggestions,
	general discussion for GNU patch." <bug-patch.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-patch>,
	<mailto:bug-patch-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-patch>
List-Post: <mailto:bug-patch@gnu.org>
List-Help: <mailto:bug-patch-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-patch>,
	<mailto:bug-patch-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 20 Aug 2011 23:20:15 -0000

patch-2.6.1.136-31a7 gets test suite failures on *BSD systems.

FreeBSD 8.2 IA-32:

29 of 31 tests failed
See tests/test-suite.log

MirBSD 10 IA-32:
FAIL: merge
FAIL: read-only-files

2 of 31 tests failed

NetBSD 5.0.2 IA-32:

FAIL: merge
FAIL: read-only-files

2 of 31 tests failed

OpenBSD 4.7 IA-32:

FAIL: merge
FAIL: read-only-files

2 of 31 tests failed

For example, on OpenBSD, tests/merge.log shows

* x 3 -- FAILED
--- expected
+++ got
@@ -1,7 +1,3 @@
-1
-2
-3
+./merge: shift: nothing to shift
 
-1
-2
-3
+./merge: shift: nothing to shift
* x 3  2d -- FAILED
--- expected
+++ got
@@ -1,5 +1,3 @@
-1
-3
+./merge: shift: nothing to shift
...

-------------------------------------------------------------------------------
- Nelson H. F. Beebe                    Tel: +1 801 581 5254                  -
- University of Utah                    FAX: +1 801 581 4148                  -
- Department of Mathematics, 110 LCB    Internet e-mail: beebe@math.utah.edu  -
- 155 S 1400 E RM 233                       beebe@acm.org  beebe@computer.org -
- Salt Lake City, UT 84112-0090, USA    URL: http://www.math.utah.edu/~beebe/ -
-------------------------------------------------------------------------------


From MAILER-DAEMON Sat Aug 20 19:20:18 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Quupu-0002h1-Ae
	for mharc-bug-patch@gnu.org; Sat, 20 Aug 2011 19:20:18 -0400
Received: from eggs.gnu.org ([140.186.70.92]:45844)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <beebe@math.utah.edu>) id 1Quupq-0002d2-BO
	for bug-patch@gnu.org; Sat, 20 Aug 2011 19:20:15 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <beebe@math.utah.edu>) id 1Quupn-0005G0-B2
	for bug-patch@gnu.org; Sat, 20 Aug 2011 19:20:14 -0400
Received: from mail.math.utah.edu ([155.101.98.135]:44864)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <beebe@math.utah.edu>) id 1Quupm-0005Ff-Ur
	for bug-patch@gnu.org; Sat, 20 Aug 2011 19:20:11 -0400
Received: from psi.math.utah.edu (psi.math.utah.edu [155.101.96.19])
	by mail.math.utah.edu (8.14.4/8.14.4) with ESMTP id p7KN347l005560;
	Sat, 20 Aug 2011 17:03:04 -0600 (MDT)
Received: from psi.math.utah.edu (localhost [127.0.0.1])
	by psi.math.utah.edu (8.14.4/8.14.4) with ESMTP id p7KN34Xo000556;
	Sat, 20 Aug 2011 17:03:04 -0600 (MDT)
Received: (from beebe@localhost)
	by psi.math.utah.edu (8.14.4/8.14.4/Submit) id p7KN34Fb000554;
	Sat, 20 Aug 2011 17:03:04 -0600 (MDT)
Date: Sat, 20 Aug 2011 17:03:04 -0600 (MDT)
From: "Nelson H. F. Beebe" <beebe@math.utah.edu>
To: bug-patch@gnu.org
X-US-Mail: "Department of Mathematics, 110 LCB, University of Utah, 155 S
	1400 E RM 233, Salt Lake City, UT 84112-0090, USA"
X-Telephone: +1 801 581 5254
X-FAX: +1 801 585 1640, +1 801 581 4148
X-URL: http://www.math.utah.edu/~beebe
Message-ID: <CMM.0.95.0.1313881384.beebe@psi.math.utah.edu>
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8
	(mail.math.utah.edu [155.101.98.135]);
	Sat, 20 Aug 2011 17:03:04 -0600 (MDT)
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 155.101.98.135
Cc: beebe@math.utah.edu
Subject: [bug-patch] patch-2.6.1.136-31a7 compilation failures on SGI IRIX
X-BeenThere: bug-patch@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports, suggestions,
	general discussion for GNU patch." <bug-patch.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-patch>,
	<mailto:bug-patch-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-patch>
List-Post: <mailto:bug-patch@gnu.org>
List-Help: <mailto:bug-patch-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-patch>,
	<mailto:bug-patch-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 20 Aug 2011 23:20:15 -0000

With native cc and c89, compilation of patch-2.6.1.136-31a7 on SGI IRIX
fails like this:

  CC     verror.o
cc-1129 c89: ERROR File = verror.h, Line = 35
  A left brace ("{") is expected at this point.

       __attribute__ ((__format__ (__printf__, 3, 0)));
       ^

cc-1012 c89: WARNING File = ///usr/include/stdlib.h, Line = 90
  Parsing restarts here after previous syntax error.

  typedef	struct {
         	       ^

cc-1174 c89: WARNING File = ///usr/include/stdlib.h, Line = 91
  The variable "quot" was declared but never referenced.

  	 int	quot;
  	    	^

cc-1174 c89: WARNING File = ///usr/include/stdlib.h, Line = 92
  The variable "rem" was declared but never referenced.

  	 int	rem;
  	    	^

cc-1077 c89: ERROR File = ///usr/include/stdlib.h, Line = 93
  The indicated declaration has no storage class or type specifier.

  	} div_t;
  	  ^

cc-1079 c89: ERROR File = ///usr/include/stdlib.h, Line = 190
  A type specifier is expected.

  extern div_t div(int, int);
         ^

cc-1220 c89: ERROR File = verror.c, Line = 43
  The function "verror" has already been defined.

  verror (int status, int errnum, const char *format, va_list args)
  ^

cc-1153 c89: ERROR File = verror.c, Line = 55
  Declaration is incompatible with previous "verror_at_line" (declared at line
          45).

  verror_at_line (int status, int errnum, const char *file,
  ^

cc-1140 c89: ERROR File = verror.c, Line = 58
  A value of type "int" cannot be used to initialize an entity of type "char *".

    char *message = xvasprintf (format, args);
                    ^

cc-1020 c89: ERROR File = verror.c, Line = 73
  The identifier "errno" is undefined.

        error (0, errno, _("unable to display error message"));
                  ^

7 errors detected in the compilation of "verror.c".

-------------------------------------------------------------------------------
- Nelson H. F. Beebe                    Tel: +1 801 581 5254                  -
- University of Utah                    FAX: +1 801 581 4148                  -
- Department of Mathematics, 110 LCB    Internet e-mail: beebe@math.utah.edu  -
- 155 S 1400 E RM 233                       beebe@acm.org  beebe@computer.org -
- Salt Lake City, UT 84112-0090, USA    URL: http://www.math.utah.edu/~beebe/ -
-------------------------------------------------------------------------------


From MAILER-DAEMON Sat Aug 20 19:20:18 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Quupu-0002hB-C0
	for mharc-bug-patch@gnu.org; Sat, 20 Aug 2011 19:20:18 -0400
Received: from eggs.gnu.org ([140.186.70.92]:45854)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <beebe@math.utah.edu>) id 1Quupr-0002eF-AZ
	for bug-patch@gnu.org; Sat, 20 Aug 2011 19:20:16 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <beebe@math.utah.edu>) id 1Quupn-0005GC-Bq
	for bug-patch@gnu.org; Sat, 20 Aug 2011 19:20:15 -0400
Received: from mail.math.utah.edu ([155.101.98.135]:44866)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <beebe@math.utah.edu>) id 1Quupm-0005Fh-Uy
	for bug-patch@gnu.org; Sat, 20 Aug 2011 19:20:11 -0400
Received: from psi.math.utah.edu (psi.math.utah.edu [155.101.96.19])
	by mail.math.utah.edu (8.14.4/8.14.4) with ESMTP id p7KN0xL8005469;
	Sat, 20 Aug 2011 17:00:59 -0600 (MDT)
Received: from psi.math.utah.edu (localhost [127.0.0.1])
	by psi.math.utah.edu (8.14.4/8.14.4) with ESMTP id p7KN0xbS000541;
	Sat, 20 Aug 2011 17:00:59 -0600 (MDT)
Received: (from beebe@localhost)
	by psi.math.utah.edu (8.14.4/8.14.4/Submit) id p7KN0xeX000540;
	Sat, 20 Aug 2011 17:00:59 -0600 (MDT)
Date: Sat, 20 Aug 2011 17:00:59 -0600 (MDT)
From: "Nelson H. F. Beebe" <beebe@math.utah.edu>
To: bug-patch@gnu.org
X-US-Mail: "Department of Mathematics, 110 LCB, University of Utah, 155 S
	1400 E RM 233, Salt Lake City, UT 84112-0090, USA"
X-Telephone: +1 801 581 5254
X-FAX: +1 801 585 1640, +1 801 581 4148
X-URL: http://www.math.utah.edu/~beebe
Message-ID: <CMM.0.95.0.1313881259.beebe@psi.math.utah.edu>
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8
	(mail.math.utah.edu [155.101.98.135]);
	Sat, 20 Aug 2011 17:00:59 -0600 (MDT)
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 155.101.98.135
Cc: beebe@math.utah.edu
Subject: [bug-patch]  patch-2.6.1.136-31a7 test suite failures on SGI IRIX
X-BeenThere: bug-patch@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports, suggestions,
	general discussion for GNU patch." <bug-patch.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-patch>,
	<mailto:bug-patch-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-patch>
List-Post: <mailto:bug-patch@gnu.org>
List-Help: <mailto:bug-patch-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-patch>,
	<mailto:bug-patch-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 20 Aug 2011 23:20:16 -0000

patch-2.6.1.136-31a7 gets test suite failures on SGI IRIX systems:

FAIL: crlf-handling
FAIL: merge

2 of 31 tests failed

Those results were with CC=gcc-3.4.6.  The tests/crlf-handling.log file
begins:

FAIL: crlf-handling (exit: 1)
=============================

* patch c < ab.diff -- FAILED
--- expected
+++ got
@@ -1,2 +1 @@
-(Stripping trailing CRs from patch.)
-patching file c
+/local/build/gcc/patch-2.6.1.136-31a7/src/patch: **** Only garbage was found in the patch input.
* patch c < ab.diff -- FAILED
--- expected
+++ got
@@ -1,2 +1 @@
-(Stripping trailing CRs from patch.)
-patching file c
+/local/build/gcc/patch-2.6.1.136-31a7/src/patch: **** Only garbage was found in the patch input.
* patch c < ab.diff -- FAILED
--- expected
+++ got
@@ -1,2 +1 @@
-(Stripping trailing CRs from patch.)
-patching file c
+/local/build/gcc/patch-2.6.1.136-31a7/src/patch: **** Only garbage was found in the patch input.
...

The tests/merge.log file looks like this:

FAIL: merge (exit: 1)
=====================

* x 3 -- FAILED
--- expected
+++ got
@@ -1,7 +1 @@
-1
-2
-3
-
-1
-2
-3
+./merge[9]: shift: bad number
* x 3  2d -- FAILED
--- expected
+++ got
@@ -1,5 +1 @@
-1
-3
-
-1
-3
+./merge[9]: shift: bad number
* x 2  2i\ b -- FAILED
--- expected
+++ got
@@ -1,7 +1 @@
-1
-b
-2
-
-1
-b
-2
+./merge[9]: shift: bad number
* x 3  2i\ b -- 3i\ c -- ok
* x 3  2c\ 2b -- 2c\ 2c -- ok
* x 3  2d -- 2d -- ok
* x 2  2i\ bc -- 2i\ bc -- ok
* x 4  2a\ a 2a\ a -- 2a\ a 2a\ a -- ok
* x 2  1i\ a 1i\ b -- 1i\ a 1i\ b -- ok
* x 2  2a\ a 2a\ b -- 2a\ a 2a\ b -- ok
* x 4  2d -- 3d -- ok
* x 4  3d -- 2d -- ok
* x 3  3i\ b -- 2d -- ok
* x 3  2d -- 3i\ b -- ok
* x 1  1c\ b -- 1c\ c -- ok
* x 4  2c\ a 3c\ b -- 2c\ a 3c\ c -- ok
* x 6  3c\ 3b 4c\ 4b -- 3c\ 3c 4c\ 4c -- ok
* x 4  2c\ b 3c\ a -- 2c\ c 3c\ a -- ok
* x 3  2i\ b 3i\ b -- 2i\ c -- ok
* x 3  2i\ b 3i\ b 3i\ b -- 2i\ c -- ok
* x 9  4c\ a 5c\ b 6c\ a -- 4c\ a 5c\ c 6c\ a -- ok
* x 3  2i\ b 3i\ b -- 1i\ 0 -- ok
* x 4  2i\ b 4i\ b -- 1i\ 0 3i\ c -- ok
* x 5  2,4d -- 3c\ 3c -- ok
* x 5  3c\ 3c -- 2,4d -- ok
* x 3  1,2d -- 2i\ c -- ok
* x 3  2i\ c -- 1,2d -- ok
27 tests (24 passed, 3 failed)

-------------------------------------------------------------------------------
- Nelson H. F. Beebe                    Tel: +1 801 581 5254                  -
- University of Utah                    FAX: +1 801 581 4148                  -
- Department of Mathematics, 110 LCB    Internet e-mail: beebe@math.utah.edu  -
- 155 S 1400 E RM 233                       beebe@acm.org  beebe@computer.org -
- Salt Lake City, UT 84112-0090, USA    URL: http://www.math.utah.edu/~beebe/ -
-------------------------------------------------------------------------------


From MAILER-DAEMON Mon Aug 22 16:49:06 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QvbQg-0006gf-Li
	for mharc-bug-patch@gnu.org; Mon, 22 Aug 2011 16:49:06 -0400
Received: from eggs.gnu.org ([140.186.70.92]:40527)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bruno@clisp.org>) id 1QvbQe-0006gW-5b
	for bug-patch@gnu.org; Mon, 22 Aug 2011 16:49:05 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <bruno@clisp.org>) id 1QvbQc-0007jb-Si
	for bug-patch@gnu.org; Mon, 22 Aug 2011 16:49:04 -0400
Received: from mo-p00-ob.rzone.de ([81.169.146.162]:48909)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bruno@clisp.org>) id 1QvbQc-0007it-88
	for bug-patch@gnu.org; Mon, 22 Aug 2011 16:49:02 -0400
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1314046135; l=690;
	s=domk; d=haible.de;
	h=Content-Transfer-Encoding:Content-Type:MIME-Version:In-Reply-To:
	References:Cc:Date:Subject:To:From:X-RZG-CLASS-ID:X-RZG-AUTH;
	bh=iO+YXoXF8JVq6oVLwSucc+/RupQ=;
	b=MIgKwsjnRyG5Ees4jg3Fwc8fDRNMg1Zw/dfPuCiXbKEICui17xrFm0CYbhYKblE1weZ
	RiLNxOZW7OKEdlT5/gjLPvyAHXESHsh3IcGu6iAXsmJb7NRkOXJkCFPaujTWghW1wR977
	Frvdzbld2nfnIOioBG+2UPGw0aXkBESXSn8=
X-RZG-AUTH: :Ln4Re0+Ic/6oZXR1YgKryK8brksyK8dozXDwHXjf9hj/zDNRav445DE8
X-RZG-CLASS-ID: mo00
Received: from linuix.haible.de
	(dslb-088-068-038-069.pools.arcor-ip.net [88.68.38.69])
	by smtp.strato.de (klopstock mo28) (RZmta 26.2)
	with ESMTPA id 3005d4n7MJRfka ; Mon, 22 Aug 2011 22:48:16 +0200 (MEST)
From: Bruno Haible <bruno@clisp.org>
To: bug-patch@gnu.org
Date: Mon, 22 Aug 2011 22:50:34 +0200
User-Agent: KMail/1.13.6 (Linux/2.6.37.6-0.5-desktop; KDE/4.6.0; x86_64; ; )
References: <CMM.0.95.0.1313880729.beebe@psi.math.utah.edu>
In-Reply-To: <CMM.0.95.0.1313880729.beebe@psi.math.utah.edu>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Message-Id: <201108222250.34808.bruno@clisp.org>
X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta)
X-Received-From: 81.169.146.162
Cc: "Nelson H. F. Beebe" <beebe@math.utah.edu>
Subject: Re: [bug-patch] patch-2.6.1.136-31a7 compilation failures on
	Solaris 11 Intel
X-BeenThere: bug-patch@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports, suggestions,
	general discussion for GNU patch." <bug-patch.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-patch>,
	<mailto:bug-patch-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-patch>
List-Post: <mailto:bug-patch@gnu.org>
List-Help: <mailto:bug-patch-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-patch>,
	<mailto:bug-patch-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 22 Aug 2011 20:49:05 -0000

Nelson H. F. Beebe wrote:
> patch-2.6.1.136-31a7 fails to compile on Solaris 11 Intel:
> 
>   CC     dup-safer.o
> "dup-safer.c", line 33: undefined symbol: STDERR_FILENO

It works fine for me on Solaris 11 2011-10 (snv_151a). Builds fine,
passes all tests except 'crlf-handling' and 'merge'.

dup-safer.c uses STDERR_FILENO but also includes <unistd.h> from gnulib,
which includes the system's <unistd.h>, which on Solaris defines STDERR_FILENO.
Therefore you need to do more investigations. As usual, the first step is to
look at the preprocessor output of that compilation command.

Bruno
-- 
In memoriam Alexander Bessmertny <http://de.wikipedia.org/wiki/Alexander_Bessmertny>


From MAILER-DAEMON Mon Aug 22 16:57:37 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QvbYv-0004sY-5A
	for mharc-bug-patch@gnu.org; Mon, 22 Aug 2011 16:57:37 -0400
Received: from eggs.gnu.org ([140.186.70.92]:49195)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bruno@clisp.org>) id 1QvbYs-0004qo-Jm
	for bug-patch@gnu.org; Mon, 22 Aug 2011 16:57:35 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <bruno@clisp.org>) id 1QvbYr-0000qe-Ec
	for bug-patch@gnu.org; Mon, 22 Aug 2011 16:57:34 -0400
Received: from mo-p00-ob.rzone.de ([81.169.146.160]:18138)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bruno@clisp.org>)
	id 1QvbYq-0000q9-J5; Mon, 22 Aug 2011 16:57:33 -0400
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1314046649; l=651;
	s=domk; d=haible.de;
	h=Content-Transfer-Encoding:Content-Type:MIME-Version:In-Reply-To:
	References:Cc:Date:Subject:To:From:X-RZG-CLASS-ID:X-RZG-AUTH;
	bh=bPzR2OcyYnzR4jU+JBusHwXZPYI=;
	b=l2BRQnmfUo2vJvK0LgigwiRaarZj7y4uXrcfyqR8KVsSjlFgCLzPdc1MKUPQf623IH2
	jrnKW4V3hfFhi0l3ep+xQMLY0yTJiYckPMQ9x9pO1vw7UnP+RRa0fr4nNyhFrfHR7ESNJ
	36dUzPCvgsmYsgXpnjweZsp09ayGnrZRiS8=
X-RZG-AUTH: :Ln4Re0+Ic/6oZXR1YgKryK8brksyK8dozXDwHXjf9hj/zDNRav445DE8
X-RZG-CLASS-ID: mo00
Received: from linuix.haible.de
	(dslb-088-068-038-069.pools.arcor-ip.net [88.68.38.69])
	by post.strato.de (mrclete mo45) (RZmta 26.2)
	with ESMTPA id 602dean7MJ9pl0 ; Mon, 22 Aug 2011 22:56:47 +0200 (MEST)
From: Bruno Haible <bruno@clisp.org>
To: bug-patch@gnu.org,
 bug-gnulib@gnu.org
Date: Mon, 22 Aug 2011 22:59:05 +0200
User-Agent: KMail/1.13.6 (Linux/2.6.37.6-0.5-desktop; KDE/4.6.0; x86_64; ; )
References: <CMM.0.95.0.1313881384.beebe@psi.math.utah.edu>
In-Reply-To: <CMM.0.95.0.1313881384.beebe@psi.math.utah.edu>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Message-Id: <201108222259.05765.bruno@clisp.org>
X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta)
X-Received-From: 81.169.146.160
Cc: "Nelson H. F. Beebe" <beebe@math.utah.edu>
Subject: Re: [bug-patch] patch-2.6.1.136-31a7 compilation failures on SGI
	IRIX
X-BeenThere: bug-patch@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports, suggestions,
	general discussion for GNU patch." <bug-patch.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-patch>,
	<mailto:bug-patch-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-patch>
List-Post: <mailto:bug-patch@gnu.org>
List-Help: <mailto:bug-patch-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-patch>,
	<mailto:bug-patch-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 22 Aug 2011 20:57:35 -0000

Nelson H. F. Beebe wrote in
<http://lists.gnu.org/archive/html/bug-patch/2011-08/msg00013.html>:
> With native cc and c89, compilation of patch-2.6.1.136-31a7 on SGI IRIX
> fails like this:
> 
>   CC     verror.o
> cc-1129 c89: ERROR File = verror.h, Line = 35
>   A left brace ("{") is expected at this point.
> 
>        __attribute__ ((__format__ (__printf__, 3, 0)));
>        ^

This was a bug in gnulib that was introduced on 2011-02-13 and
fixed on 2011-03-20. The tarball of patch-2.6.1.136-31a7 was unlucky enough
to pick up one of the buggy versions.

Bruno
-- 
In memoriam Alexander Bessmertny <http://de.wikipedia.org/wiki/Alexander_Bessmertny>


