From MAILER-DAEMON Wed Oct 22 10:57:08 2025
Received: from list by lists.gnu.org with archive (Exim 4.90_1)
	id 1vBaGy-0007hr-F5
	for mharc-bug-diffutils@gnu.org; Wed, 22 Oct 2025 10:57:08 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1vBaGt-0007hc-GI
 for bug-diffutils@gnu.org; Wed, 22 Oct 2025 10:57:03 -0400
Received: from debbugs.gnu.org ([2001:470:142:5::43])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1vBaGt-0008EU-64
 for bug-diffutils@gnu.org; Wed, 22 Oct 2025 10:57:03 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
 d=debbugs.gnu.org; s=debbugs-gnu-org; 
 h=MIME-Version:From:Date:To:Subject;
 bh=bEDpiSzufHUb40TuEdkS01RT21tDg+9COxbzSkwq6wk=; 
 b=F2/L26rN2QI9vbKaqwKkyOVulidZ6GPbDAPBgEuzfAaYiwGVGUTkv/hMKqqXRXvZte2UWb8iJOcY2hIGBR4j1SDQfEOjm0ccgfqBwAs4WsWMW31MCHkSfvGwIFI1bqAvYtSpEvPU4UkOrwQccHmcyAI7hUz964C1kXk9mx2w9w50nBhhh4LFNy4DTd8fe8BZpyxeCpph0C8q8rmtFH+6/S3cOSXwlJfIcvJ4NnUm9XdK/hEsunsSnNbseJWNAo/3H8cbHTXREZOYxVgVso7A0nqf2PgVK1Chlmv3dIYkhL7dr4gYhxOjt+WkD41d3ZkbUH+FW3DI3swGoDVIEdxj8Q==;
Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1vBaGs-0003kM-LF
 for bug-diffutils@gnu.org; Wed, 22 Oct 2025 10:57:02 -0400
X-Loop: help-debbugs@gnu.org
Resent-From: Santiago Vila <sanvila@debian.org>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: bug-diffutils@gnu.org
Resent-Date: Wed, 22 Oct 2025 14:57:02 +0000
Resent-Message-ID: <handler.79676.B.176114502114391@debbugs.gnu.org>
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: report 79676
X-GNU-PR-Package: diffutils
X-GNU-PR-Keywords: 
To: 79676@debbugs.gnu.org
Cc: Werner Frey <trollo@franken-online.de>, 1118586@bugs.debian.org
X-Debbugs-Original-To: bug-diffutils@gnu.org
Received: via spool by submit@debbugs.gnu.org id=B.176114502114391
 (code B ref -1); Wed, 22 Oct 2025 14:57:02 +0000
Received: (at submit) by debbugs.gnu.org; 22 Oct 2025 14:57:01 +0000
Received: from localhost ([127.0.0.1]:57216 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1vBaGr-0003k2-2l
 for submit@debbugs.gnu.org; Wed, 22 Oct 2025 10:57:01 -0400
Received: from lists.gnu.org ([2001:470:142::17]:40990)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <sanvila@debian.org>)
 id 1vBaGn-0003jh-Ur
 for submit@debbugs.gnu.org; Wed, 22 Oct 2025 10:56:59 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <sanvila@debian.org>)
 id 1vBaGi-0007hB-1J
 for bug-diffutils@gnu.org; Wed, 22 Oct 2025 10:56:52 -0400
Received: from stravinsky.debian.org ([2001:41b8:202:deb::311:108])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <sanvila@debian.org>)
 id 1vBaGg-0008DR-9s
 for bug-diffutils@gnu.org; Wed, 22 Oct 2025 10:56:51 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debian.org; 
 s=smtpauto.stravinsky;
 h=X-Debian-User:Content-Type:MIME-Version:Message-ID:
 Subject:Cc:To:From:Date:Reply-To:Content-Transfer-Encoding:Content-ID:
 Content-Description:In-Reply-To:References;
 bh=bEDpiSzufHUb40TuEdkS01RT21tDg+9COxbzSkwq6wk=; b=GR2hFuCk0PZBxhyG6X6u8GAiGY
 oNSNDFV7BQD+3UdRVorfeqlBXRwUBUfCUVWYvVyPTLWmxcuzNwUczhwG9cfvr2bATWVZwufFeaJjr
 nF5UfOuNQaJ1OkLSUynfknaRSCqlFcZCSEGSO/IRs3vYr52tG/spH9rFHL7yFznbHSHPasOUWt7GS
 VfXaK2Hm5ewzbxbPWBR4VmOXd34Y9yVd6WaPwDE3CvaUymS3+0UKGcUE5F1BXhikzGUe0SiHauOKp
 Thh3YfwG45Vcc0WBqWFw1VRny4tLQpPOLPIlD0FxbM8tUVcK3emCAAfDq5sbt3nedUJMZjcKWNUZF
 xD/bGnOw==;
Received: from authenticated user by stravinsky.debian.org with esmtpsa
 (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256)
 (Exim 4.94.2) (envelope-from <sanvila@debian.org>)
 id 1vBaGW-007Tek-Oc; Wed, 22 Oct 2025 14:56:40 +0000
Date: Wed, 22 Oct 2025 16:56:38 +0200
From: Santiago Vila <sanvila@debian.org>
Message-ID: <aPjwpiF_C14wxMMW@nuc>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
X-Debian-User: sanvila
Received-SPF: none client-ip=2001:41b8:202:deb::311:108;
 envelope-from=sanvila@debian.org; helo=stravinsky.debian.org
X-Spam_score_int: -43
X-Spam_score: -4.4
X-Spam_bar: ----
X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001,
 DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_NONE=0.001,
 UNPARSEABLE_RELAY=0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
Errors-To: debbugs-submit-bounces@debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
X-Spam-Score: -1.0 (-)
Subject: [bug-diffutils] bug#79676: [trollo@franken-online.de: Bug#1118586:
 diffutils: diff --to-file=directory no longer works as expected]
X-BeenThere: bug-diffutils@gnu.org
List-Id: "All diffutils discussion." <bug-diffutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-diffutils>,
 <mailto:bug-diffutils-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/bug-diffutils>
List-Post: <mailto:bug-diffutils@gnu.org>
List-Help: <mailto:bug-diffutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-diffutils>,
 <mailto:bug-diffutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 22 Oct 2025 14:57:04 -0000

Hello.

I received the following report from the Debian bug system.
Thanks.

----- Forwarded message from Werner Frey <trollo@franken-online.de> -----

Date: Wed, 22 Oct 2025 16:27:49 +0200
From: Werner Frey <trollo@franken-online.de>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: Bug#1118586: diffutils: diff --to-file=directory no longer works as expected

Package: diffutils
Version: 1:3.12-1
Severity: normal
Tags: upstream

Dear Maintainer,

since diffutils v3.12 the option "--to-file" no longer works as expected
if its argument is a directory.

diff --to-file=directory file1 file2 file3

should compare file1, file2, and file3 to directory/file1, directory/file2,
and directory/file3, respectively.
But it only compares file1 to directory/file1 and reports for the
remaining comparisons:

diff: directory: No such file or directory

[...]




From MAILER-DAEMON Wed Oct 22 19:53:07 2025
Received: from list by lists.gnu.org with archive (Exim 4.90_1)
	id 1vBide-00046l-UM
	for mharc-bug-diffutils@gnu.org; Wed, 22 Oct 2025 19:53:06 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1vBidc-00046X-K3
 for bug-diffutils@gnu.org; Wed, 22 Oct 2025 19:53:04 -0400
Received: from debbugs.gnu.org ([2001:470:142:5::43])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1vBidb-00032k-FR
 for bug-diffutils@gnu.org; Wed, 22 Oct 2025 19:53:03 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
 d=debbugs.gnu.org; s=debbugs-gnu-org; 
 h=MIME-Version:Date:References:In-Reply-To:From:To:Subject;
 bh=6KzsbvbLXhUrT3F827L8DADHjtfoe7H/jwmiCSNXqd4=; 
 b=o9I2TFulAyb6bnSy95JnEZGmjeDkkuB1zrN7x7eZWMxzQxU1SEE/DnXVgcxtfnVkaegGzwqibcKSj0T55w+WDGBO1vWKPH8C5bThXfg5JwgBb8PkiPETyi1PRaCEotnxQzgh8VHCtz1lALfifWLjyDCZtU5QVf1XBxYLsVJfilrFRueyjBEqNNtiAq4Ud2glam6qg0CtNWpJZJm9fEM8U2TPdKjdsefauUkOHC8N1B/I4eFuQaPusAGO1r5sXmBVBKd0HJOlyU1bB7oYd4x6mDHJLDr++tF/Ij1jnUq6ZYrzLNMfu0f4Gq+SDd0YWqPbR6IOCO8APQ5rdcbk7UOB1Q==;
Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1vBida-0000cP-8e
 for bug-diffutils@gnu.org; Wed, 22 Oct 2025 19:53:02 -0400
X-Loop: help-debbugs@gnu.org
Resent-From: Collin Funk <collin.funk1@gmail.com>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: bug-diffutils@gnu.org
Resent-Date: Wed, 22 Oct 2025 23:53:02 +0000
Resent-Message-ID: <handler.79676.B79676.17611771682333@debbugs.gnu.org>
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 79676
X-GNU-PR-Package: diffutils
X-GNU-PR-Keywords: 
To: Santiago Vila <sanvila@debian.org>
Cc: 79676@debbugs.gnu.org, Werner Frey <trollo@franken-online.de>,
 1118586@bugs.debian.org
Received: via spool by 79676-submit@debbugs.gnu.org id=B79676.17611771682333
 (code B ref 79676); Wed, 22 Oct 2025 23:53:02 +0000
Received: (at 79676) by debbugs.gnu.org; 22 Oct 2025 23:52:48 +0000
Received: from localhost ([127.0.0.1]:58427 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1vBidL-0000bZ-Hx
 for submit@debbugs.gnu.org; Wed, 22 Oct 2025 19:52:47 -0400
Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]:61641)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <collin.funk1@gmail.com>)
 id 1vBidI-0000b4-N6
 for 79676@debbugs.gnu.org; Wed, 22 Oct 2025 19:52:45 -0400
Received: by mail-pl1-x635.google.com with SMTP id
 d9443c01a7336-290ab379d48so1538545ad.2
 for <79676@debbugs.gnu.org>; Wed, 22 Oct 2025 16:52:44 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1761177158; x=1761781958; darn=debbugs.gnu.org;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=6KzsbvbLXhUrT3F827L8DADHjtfoe7H/jwmiCSNXqd4=;
 b=CQ0xyUWT3xGk/7Yz9Zbsmu3MGhV1k4jI6MSzdF5zaa7Lxm+y+YVkCMEgi3cuJVGMtb
 4dQSmulLSViHdFXh2J17CLRbiaf4TrLNLxRVe1TFHzidBltqmndjY7V86OHGtn/6pZFy
 XKpUEEPEiN8hu8mM+75XZp+LT1/WiMeR7D4K2cbrQB8kvWOSbMvZ+3vlrvygYdlMDxii
 kphTBEtodtuvk+Y3CE+r3aH7KoZqpc8CmE4VU6QC0TCHWDaKo/LNxgFTAFKJFbJ+U2+Q
 hSPweKJf1zCRGNrlX8iuQJbt+0s0KPT3FT5Pi9hJtLFgs3TuPNtjgK1vKjX2O2nAYxiZ
 UJYQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1761177158; x=1761781958;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=6KzsbvbLXhUrT3F827L8DADHjtfoe7H/jwmiCSNXqd4=;
 b=NaDvDIfUQ+0YO0HJaqPpHJW+M7dqd8lvgGglNFf8brrhbwp4T0oqGJ4bC9zDXOq2TO
 Qd8tzjeDa9thnaYUYnWAq0iJhi36vx8/9cV5LnXXrCerUtB/xozb514i2kQQpWdLa/L8
 MLBvG0wFCoIIcixVy3W7aP2mJsNAIL6ZEE2fY8QFaLdTUJ+gDkTpf+2BjXf1G7nLIFmp
 WAanYPwYQFQg3bxhnVQRSDydBcxjI+JOvCc6tStJp0ML05Mo5M0kpUrY7SzsGtIvt0fT
 luTtG9eL40PHF+q/pgBjsNW9NDeOTPzN7q29Cmiq4aMjAC1HcLW4SNBKqdv4Y7Lm3N3F
 3cVg==
X-Gm-Message-State: AOJu0YxkhFDqnZBHz8iGdiOkYyhM2m/EqJN9oIbVbpS8N7vXr1hlrGnZ
 Azp7w8uIHyUZTU77AHrnVl1YKKa14G+0Ay/MEqD9TPVgYAc9w41ORsEA
X-Gm-Gg: ASbGncvKvJoQAcPQ9btM7YdwdTZx1hmTpNvB9xXpSRGPMBfDjC4QNwSNUYEOPY4SnY4
 wo0j3nXpg4/vaaImCCDbdph0gerhXs5Eq2HbORCUbsKp8wSAomSaY9p9a5imfdSmnB0RUIeuGzx
 hfXAVgVxnQRY6u9lQvHrPTn0vY1B0Y1MS4/cA61Aa7HzI+UYv1lsuhqOG4YWRmVAeDFygjbTn4B
 ARxQLyBHEpKmLjYafl1KcCSxJta01ab+Y9f27z8Rz+Ms8fOnfaN3A0iYnuygkWKbsIL7jbtqDge
 zSwZEQBH8593Wv51c4xnJHE/1DyRDGDpYP99dTdN4hzhT+VlvuF48g0XX0kKbgF9sCl/H1G8k3W
 0Hi6zmRFYO2bXOmPR7RqPsqdxg+pZvi+3I3IuF5NnSeTKGs9UlgyStrBGwo1h/mJxWVBs
X-Google-Smtp-Source: AGHT+IGsVfKiUzHtVDEnrUHI2gnIeaX454z1q8Zg/e2M24ctTKQa930MI5n3gLO/w6Onz5NR737odw==
X-Received: by 2002:a17:903:2947:b0:290:bd91:d81a with SMTP id
 d9443c01a7336-290ca1219femr225441175ad.39.1761177158205; 
 Wed, 22 Oct 2025 16:52:38 -0700 (PDT)
Received: from fedora ([2601:646:8081:3770::43bc])
 by smtp.gmail.com with ESMTPSA id
 d9443c01a7336-2946dfc1314sm3068825ad.58.2025.10.22.16.52.37
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 22 Oct 2025 16:52:37 -0700 (PDT)
From: Collin Funk <collin.funk1@gmail.com>
In-Reply-To: <aPjwpiF_C14wxMMW@nuc>
References: <aPjwpiF_C14wxMMW@nuc>
Date: Wed, 22 Oct 2025 16:52:36 -0700
Message-ID: <87plae8pff.fsf@gmail.com>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.3 (/)
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
Errors-To: debbugs-submit-bounces@debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
X-Spam-Score: -0.7 (/)
Subject: [bug-diffutils] bug#79676: bug#79676: [trollo@franken-online.de:
 Bug#1118586: diffutils: diff --to-file=directory no longer works as
 expected]
X-BeenThere: bug-diffutils@gnu.org
List-Id: "All diffutils discussion." <bug-diffutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-diffutils>,
 <mailto:bug-diffutils-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/bug-diffutils>
List-Post: <mailto:bug-diffutils@gnu.org>
List-Help: <mailto:bug-diffutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-diffutils>,
 <mailto:bug-diffutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 22 Oct 2025 23:53:05 -0000

Santiago Vila <sanvila@debian.org> writes:

> Hello.
>
> I received the following report from the Debian bug system.
> Thanks.
>
> ----- Forwarded message from Werner Frey <trollo@franken-online.de> -----
>
> Date: Wed, 22 Oct 2025 16:27:49 +0200
> From: Werner Frey <trollo@franken-online.de>
> To: Debian Bug Tracking System <submit@bugs.debian.org>
> Subject: Bug#1118586: diffutils: diff --to-file=directory no longer works as expected
>
> Package: diffutils
> Version: 1:3.12-1
> Severity: normal
> Tags: upstream
>
> Dear Maintainer,
>
> since diffutils v3.12 the option "--to-file" no longer works as expected
> if its argument is a directory.
>
> diff --to-file=directory file1 file2 file3
>
> should compare file1, file2, and file3 to directory/file1, directory/file2,
> and directory/file3, respectively.
> But it only compares file1 to directory/file1 and reports for the
> remaining comparisons:
>
> diff: directory: No such file or directory

Reminds me of bug 79407. I'll have a look at a fix and adding a test.

Here is how it behaved in some older versions vs. current:

    $ mkdir -p directory && touch file{1,2,3} directory/file{1,2,3}
    $ diff-3.5 --to-file=directory file1 file2 file3
    $ echo $?
    0
    $ diff-3.10 --to-file=directory file1 file2 file3
    $ echo $?
    0
    $ diff-current --to-file=directory file1 file2 file3
    diff-current: directory: No such file or directory
    diff-current: directory: No such file or directory
    2

Thanks,
Collin

[1] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=79407




From MAILER-DAEMON Wed Oct 22 22:14:06 2025
Received: from list by lists.gnu.org with archive (Exim 4.90_1)
	id 1vBkq5-0003FJ-TD
	for mharc-bug-diffutils@gnu.org; Wed, 22 Oct 2025 22:14:05 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1vBkq4-0003F5-IW
 for bug-diffutils@gnu.org; Wed, 22 Oct 2025 22:14:04 -0400
Received: from debbugs.gnu.org ([2001:470:142:5::43])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1vBkq4-0002L0-9w
 for bug-diffutils@gnu.org; Wed, 22 Oct 2025 22:14:04 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
 d=debbugs.gnu.org; s=debbugs-gnu-org; 
 h=MIME-Version:Date:References:In-Reply-To:From:To:Subject;
 bh=h94oZGCPed6a0yIGI8DrivESVrVsu6X+ioZVZe2Nh28=; 
 b=QyrEH8Kk3AyDVF/DhozAzupgQkjGDpttJs8Ek/9Rn3RBebDg7abOB+i4AAI6s/RRhp8AROIW7kxHATZ7njA8eB18DqfnKiXfStdi9dR8wTraPp9efzvXCqlTGr0PMMP6s5GJWrSFFDzYJwjoSdWqjbwXnU1B5GBblNG85wQ32uplaoMZQji4+HsZbunxHJTcinMTSu3Yt+iBNX/Rz8gIQNkuWI5BL4NAaplyPEsVJoIQ0bQfnmi3oIesgpchpYcmWboTOC5uMloeYlParzrNJ+hf/ABkTDo6uZgD6xWHk0jTXjZxct00pmo3/Hwb+vAnswq2zmKlUZVy4C0zkBDgng==;
Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1vBkq3-0000IG-UU
 for bug-diffutils@gnu.org; Wed, 22 Oct 2025 22:14:03 -0400
X-Loop: help-debbugs@gnu.org
Resent-From: Collin Funk <collin.funk1@gmail.com>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: bug-diffutils@gnu.org
Resent-Date: Thu, 23 Oct 2025 02:14:03 +0000
Resent-Message-ID: <handler.79676.B79676.1761185597666@debbugs.gnu.org>
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 79676
X-GNU-PR-Package: diffutils
X-GNU-PR-Keywords: 
To: Santiago Vila <sanvila@debian.org>
Cc: 79676@debbugs.gnu.org, Paul Eggert <eggert@cs.ucla.edu>,
 Werner Frey <trollo@franken-online.de>, 1118586@bugs.debian.org
Received: via spool by 79676-submit@debbugs.gnu.org id=B79676.1761185597666
 (code B ref 79676); Thu, 23 Oct 2025 02:14:03 +0000
Received: (at 79676) by debbugs.gnu.org; 23 Oct 2025 02:13:17 +0000
Received: from localhost ([127.0.0.1]:58708 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1vBkpI-0000AY-Lm
 for submit@debbugs.gnu.org; Wed, 22 Oct 2025 22:13:17 -0400
Received: from mail-pg1-x531.google.com ([2607:f8b0:4864:20::531]:60459)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <collin.funk1@gmail.com>)
 id 1vBkpD-00009a-8u
 for 79676@debbugs.gnu.org; Wed, 22 Oct 2025 22:13:15 -0400
Received: by mail-pg1-x531.google.com with SMTP id
 41be03b00d2f7-b6cf07258e3so185410a12.0
 for <79676@debbugs.gnu.org>; Wed, 22 Oct 2025 19:13:11 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1761185584; x=1761790384; darn=debbugs.gnu.org;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=h94oZGCPed6a0yIGI8DrivESVrVsu6X+ioZVZe2Nh28=;
 b=AkxjhBnDGWLZEz8o9IJF5BGH2XxvPR1G6qUGJ4CY9HHEkHAtyE072H8NMUzcd2F2Xb
 SBfTMD7CH5LzkkKg7kY6jQ0Df3ZzYWdCPI1Fnzv091XvqS6JXwU9SC9ZlwzUCtwpXdw/
 IlNyIatzz9zTp6RQAEQSiGPrASkBELkx5UNBkF4CXd2uK9/4qJXrcRv+5iZjuip9avso
 qzfkiC80ejXh5ZYsKI/Ti7kx/gIVr4t4R9MzjeyPPHv4fKWaSc+E5jTmAKS1iOyOHxTc
 bhRqMFvw7ikm4s8kdOnrSs0bbLNXBADBtMaT5zkfbLwfen/KGzxZzqgwEpsOe4HcKyHt
 ni5g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1761185584; x=1761790384;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=h94oZGCPed6a0yIGI8DrivESVrVsu6X+ioZVZe2Nh28=;
 b=jdIUldMmrjJC7Ym6xpUXKVl3JAO1lIzcilKtrNa+AMK9FW+9t6z/poBRCuZa062wvf
 agZhr4QnCX4GLTmTKklsaKxH6+B55xg/tf1Tjgm3XgUPbEbBoDWn4/EApwsjP5WmP4aF
 4K01nVAxbIuuCiTYBO5TjFmXwcM1k4rcmVHaxJ/7ngbEmDxTJK0inPbMnkX2Ha7dN8nP
 Eto9jgni4QN2z82EvL2KbTwAUOQwoiX5xV3DFc3uZdU1W1cixWSMMDSRXhLbMollmlPh
 XGm2VNbDsVfY6T6DFGmbunzXw28My5oXNcEzmmHMpOxR4eXSwqwhp6Mv8Rrfg7TT1o3F
 Hf7g==
X-Gm-Message-State: AOJu0YxnMzDL+eDEjHHKr7bpvhcwgvqZZ9Gi2Fu+M8aC+B5z1rcggwC6
 kOsFxaEjUP2pYmzwFadVO8QUM07RcaeHK0bcNRuM+xZ/3ift1dQdH/hv
X-Gm-Gg: ASbGncvTFMJ29RD1NUU5ncRse0/K3oQVwy0iAXHzsIVnQMCEOB5CjJXSmbsE3c0lWuV
 nUb4HnwKys3Wse1E5PP0af0IcMBqgiwEDKdzdxpaGzFG0PxlEqcwJrLNopfyy0nBAuwkR99fiYB
 dDeumlAFM3O8ghh/pxcZiRBZP3Agsk3/tKRY9tN2BEh38IJKt++4rHlAJ4v+5cQHxWvLJocopNA
 7LWQ2U0fkuxCveP3xgpbvDyCQxmfl6vdoo8i4LpscQEcENrEu5ZuUS7+v1tlHqxot4V7+jk2c27
 GNLm+oBkXHlD8qBjijY5zLo5O6K0JHZ7ZRBMWwQHlMs+MDhWIogjFcOYJJIfij0ZlyInuxA4nTJ
 VdQyWlbvHwR26hiczfcgTApVTv6h9FC+EtrR9ldFc1C5aAKcycE6UfEcbc0Qe8ERtVrfB
X-Google-Smtp-Source: AGHT+IEdB1gc8K2Yzn1LnYVW6NxZTyMMMmT+5lhziIDdf7lo7zlc3AhKsztFEcwzKtSPAUKMIOIWmw==
X-Received: by 2002:a17:903:4407:b0:27e:ef27:1e52 with SMTP id
 d9443c01a7336-290ca1218dfmr275239135ad.35.1761185584268; 
 Wed, 22 Oct 2025 19:13:04 -0700 (PDT)
Received: from fedora ([2601:646:8081:3770::43bc])
 by smtp.gmail.com with ESMTPSA id
 d9443c01a7336-2946de0c927sm5819395ad.46.2025.10.22.19.13.03
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 22 Oct 2025 19:13:03 -0700 (PDT)
From: Collin Funk <collin.funk1@gmail.com>
In-Reply-To: <87plae8pff.fsf@gmail.com>
References: <aPjwpiF_C14wxMMW@nuc> <87plae8pff.fsf@gmail.com>
Date: Wed, 22 Oct 2025 19:13:02 -0700
Message-ID: <87ikg68ixd.fsf@gmail.com>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.3 (/)
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
Errors-To: debbugs-submit-bounces@debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
X-Spam-Score: -0.7 (/)
Subject: [bug-diffutils] bug#79676: bug#79676: bug#79676:
 [trollo@franken-online.de: Bug#1118586: diffutils: diff --to-file=directory
 no longer works as expected]
X-BeenThere: bug-diffutils@gnu.org
List-Id: "All diffutils discussion." <bug-diffutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-diffutils>,
 <mailto:bug-diffutils-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/bug-diffutils>
List-Post: <mailto:bug-diffutils@gnu.org>
List-Help: <mailto:bug-diffutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-diffutils>,
 <mailto:bug-diffutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 23 Oct 2025 02:14:04 -0000

Collin Funk <collin.funk1@gmail.com> writes:

> Reminds me of bug 79407. I'll have a look at a fix and adding a test.
>
> Here is how it behaved in some older versions vs. current:
>
>     $ mkdir -p directory && touch file{1,2,3} directory/file{1,2,3}
>     $ diff-3.5 --to-file=directory file1 file2 file3
>     $ echo $?
>     0
>     $ diff-3.10 --to-file=directory file1 file2 file3
>     $ echo $?
>     0
>     $ diff-current --to-file=directory file1 file2 file3
>     diff-current: directory: No such file or directory
>     diff-current: directory: No such file or directory
>     2
>
> Thanks,
> Collin
>
> [1] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=79407

Hey Paul, can you take a look at this one?

I have bisected it to this commit:

commit ce65fcbeec251c952df2788a8b6c4131c46e7cea
Author:     Paul Eggert <eggert@cs.ucla.edu>
AuthorDate: Sun Jul 30 17:04:17 2023 -0700
Commit:     Paul Eggert <eggert@cs.ucla.edu>
CommitDate: Sat Aug 5 11:01:41 2023 -0700

    diff: avoid a race when opening files
    
    * src/diff.c (O_PATHSEARCH): New constant.
    (compare_files): Prefer openat+fstat to fstatat+openat,
    as it avoids a race and should be a bit faster.

Here is what I see from strace:

    $ strace diff --to-file=directory file1 file2 file3 2>&1 | grep ^openat
    [...]
    openat(AT_FDCWD, "file1", O_RDONLY|O_CLOEXEC) = 3
    openat(AT_FDCWD, "directory", O_RDONLY|O_CLOEXEC) = 4
    openat(4, "file1", O_RDONLY|O_CLOEXEC)  = 5
    openat(AT_FDCWD, "file2", O_RDONLY|O_CLOEXEC) = 3
    openat(4, "directory", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
    [...]
    openat(AT_FDCWD, "file3", O_RDONLY|O_CLOEXEC) = 3
    openat(4, "directory", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)

So it looks like we set the file descriptor of NOPARENT to the file
descriptor of "directory". But we do not give openat the correct name.

The code is quite complex, so I feel like you will have an easier time
coming up with the correct fix.

Collin




From MAILER-DAEMON Wed Oct 22 22:52:04 2025
Received: from list by lists.gnu.org with archive (Exim 4.90_1)
	id 1vBlQq-0001DK-Lr
	for mharc-bug-diffutils@gnu.org; Wed, 22 Oct 2025 22:52:04 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1vBlQp-0001DC-BY
 for bug-diffutils@gnu.org; Wed, 22 Oct 2025 22:52:03 -0400
Received: from debbugs.gnu.org ([2001:470:142:5::43])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1vBlQp-0006sh-3N
 for bug-diffutils@gnu.org; Wed, 22 Oct 2025 22:52:03 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
 d=debbugs.gnu.org; s=debbugs-gnu-org; 
 h=Date:From:In-Reply-To:References:MIME-Version:To:Subject;
 bh=lwQG/w9PCtelkkCcU3LUMJyT9VDoXnBTdPPZR3su5zU=; 
 b=JRuPj9qZe6AdmKr7D/1jeSuzEu9iHwem31hYhvCaYJKopbropMwZMJk2WJx4B8DFqt6/SArjdDMcW3ans3ISepg5HyFB054NAf3Ipx0TdVa5UpcUxoNSvZM4ihQ1QCm2TKg5YDANlb49wYN0jfhZjGiFqTI1ni2Hjxn0zSZmhJ5fVCvmrg/2qFvR3DDp/Tjv1KnDskyQ/jZBTrmoK6wJPXEKymE98XvUMvIsN2ejvQYqVkt25JBlCzg38SM7PsiAmdCpFjOxQWLg0MVcYXfZlrM38FOqRP3D7tRIjxGFaFXC7EJMNGejJGCCnzandpjSEwWuARKMmN6ieoo7ClsHNQ==;
Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1vBlQo-00037k-G2
 for bug-diffutils@gnu.org; Wed, 22 Oct 2025 22:52:02 -0400
X-Loop: help-debbugs@gnu.org
Resent-From: Robert Webb <ro.webbdg@gmail.com>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: bug-diffutils@gnu.org
Resent-Date: Thu, 23 Oct 2025 02:52:02 +0000
Resent-Message-ID: <handler.79676.B79676.176118788811953@debbugs.gnu.org>
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 79676
X-GNU-PR-Package: diffutils
X-GNU-PR-Keywords: 
To: Collin Funk <collin.funk1@gmail.com>
Cc: Santiago Vila <sanvila@debian.org>, 79676@debbugs.gnu.org,
 Werner Frey <trollo@franken-online.de>, 1118586@bugs.debian.org
Received: via spool by 79676-submit@debbugs.gnu.org id=B79676.176118788811953
 (code B ref 79676); Thu, 23 Oct 2025 02:52:02 +0000
Received: (at 79676) by debbugs.gnu.org; 23 Oct 2025 02:51:28 +0000
Received: from localhost ([127.0.0.1]:58782 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1vBlQF-00036j-Tl
 for submit@debbugs.gnu.org; Wed, 22 Oct 2025 22:51:28 -0400
Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]:44135)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <ro.webbdg@gmail.com>)
 id 1vBlQD-00036V-7F
 for 79676@debbugs.gnu.org; Wed, 22 Oct 2025 22:51:26 -0400
Received: by mail-ed1-x52f.google.com with SMTP id
 4fb4d7f45d1cf-637e9f9f9fbso518266a12.0
 for <79676@debbugs.gnu.org>; Wed, 22 Oct 2025 19:51:25 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1761187879; x=1761792679; darn=debbugs.gnu.org;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:from:to:cc:subject:date:message-id:reply-to;
 bh=lwQG/w9PCtelkkCcU3LUMJyT9VDoXnBTdPPZR3su5zU=;
 b=J4cXCBBb2momVD5SXPs9LuJgybi7fAuKNyAOlmC8rY0D6DmuOwkSSsdVtP/rSz2I0B
 o5rmupHc9lwcx0aIYMNG6EvNi7naEfbJHKwLM1UaURZuWvHXq+lZ2IuMy6FzKI4rWC9G
 jtMdtlTT6Qd9squDuNVTqtx6uNFAXZv2s4AqfJKGPNshebXPrXDMN/kwZBrbELbk1HhG
 QHVn81Jo+9BNwC25/ZlCnH/M6JSCvoejmpXZvstvZM8kK6S6ulr6cmAyIrZABBRqpOXD
 o96pYzr5ozQyGe2sJSbXbZ/YChs6dFuegokNcYXimR1YN8T7Nj7GmheNPl2Q4xPs7SR/
 jcAw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1761187879; x=1761792679;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=lwQG/w9PCtelkkCcU3LUMJyT9VDoXnBTdPPZR3su5zU=;
 b=GrHp/WcmCBycl4ssvx3jOWIarKynO70wCYt+yIAwRDXB6jpJVn/TCAoy+ru0Hvt7YS
 dFSNp6Xn1oUm8txWt9vfnky96s5fpv/quosNu3Rim9RVKml3ZBbCFThtLQ9vZGQxH9r5
 AzfRHhN1M+ntdwjrsZKvNAE4+kXs1uPKVu//IQ5YXLUv65KtKvRdOM6rtLDoNydZccOV
 j+fDHzwPior7I8WCFYuf+hvk1IpIYzSs12aNUjqgH1bq/OXDbipe1s5AWDNQlknUoyjT
 YNlvi8qwVwuf1Q0yoIGb91ATNnLILKN4V0c6eT9BVKa51045ZybgXYyF2lP6TBdvbUUl
 +KsA==
X-Forwarded-Encrypted: i=1;
 AJvYcCUjP/63X30x9CxZzLk6Ak9f36YN9z3o34FFCpYHWV+jhU7wdu+7jUUupQCUSH4kw2O1+RxcHA==@debbugs.gnu.org
X-Gm-Message-State: AOJu0Yw9DnTfSH6AH7p4mkbn4jTbsq7KtqW2E2O4uaRG08JJXvnyg8SA
 aHKRjl01v0etB2wXSyh3Km50IZJWha8NwTNydsZrZMxogV0D/JuEmXQymFse1iwSqRVH9loFl/y
 4b9q3l84BYR0B7CQTK68BrhPlVz5CpoI=
X-Gm-Gg: ASbGnctq8f9H0//4vV+1yY6coXma7AJzypQuoN4jUQw10kS7h9w4GKqD75dsMrH4M0r
 3XhegVQvcyeIHkmHhPtuD5GSXZSAXTE70uIhKMXNt/z+vpUxD2XF9oz050av589746khF3CLNTp
 H5ywaj8EwkdvkypqMw9o27ywbZh22RBDM9URjEAa5n5AOdqSmYoGVK10tA/yKHkra12ccmAgU6u
 HmZ1OL6PgujbHp/v8QycbNmmyZjsRTs/8fQ6c3VrMaDQNoKmDbS4COJQg==
X-Google-Smtp-Source: AGHT+IFglTRZOMSRJfRam87kl4ElUxXyYkFOKhiUKSlDEhDHjsoYLCxKNjLwtePksULprkgWDDc4LaOWjVF2MHwPQSM=
X-Received: by 2002:a05:6402:2815:b0:639:6bc8:c7bd with SMTP id
 4fb4d7f45d1cf-63e3e10e472mr912196a12.15.1761187878579; Wed, 22 Oct 2025
 19:51:18 -0700 (PDT)
MIME-Version: 1.0
References: <aPjwpiF_C14wxMMW@nuc> <87plae8pff.fsf@gmail.com>
In-Reply-To: <87plae8pff.fsf@gmail.com>
From: Robert Webb <ro.webbdg@gmail.com>
Date: Wed, 22 Oct 2025 19:51:01 -0700
X-Gm-Features: AS18NWCcAtuKxVGzgeFhpWaxQnrKm2I0b98n_UForobz_ytRNgZ2Qb0n4kdjZP4
Message-ID: <CALRuq+J02zDuX6o_1coAw5DRW9QxU+L0xNZpdtu9Qju2ruV7Fg@mail.gmail.com>
Content-Type: multipart/mixed; boundary="000000000000e2e0a60641ca81c0"
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
Errors-To: debbugs-submit-bounces@debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
X-Spam-Score: -1.0 (-)
Subject: [bug-diffutils] bug#79676: bug#79676: bug#79676:
 [trollo@franken-online.de: Bug#1118586: diffutils: diff --to-file=directory
 no longer works as expected]
X-BeenThere: bug-diffutils@gnu.org
List-Id: "All diffutils discussion." <bug-diffutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-diffutils>,
 <mailto:bug-diffutils-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/bug-diffutils>
List-Post: <mailto:bug-diffutils@gnu.org>
List-Help: <mailto:bug-diffutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-diffutils>,
 <mailto:bug-diffutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 23 Oct 2025 02:52:03 -0000

--000000000000e2e0a60641ca81c0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Wed, Oct 22, 2025 at 4:53=E2=80=AFPM Collin Funk <collin.funk1@gmail.com=
> wrote:
> Santiago Vila <sanvila@debian.org> writes:
>
> > since diffutils v3.12 the option "--to-file" no longer works as expecte=
d
> > if its argument is a directory.
> >
> > diff --to-file=3Ddirectory file1 file2 file3
> >
> > should compare file1, file2, and file3 to directory/file1, directory/fi=
le2,
> > and directory/file3, respectively.
> > But it only compares file1 to directory/file1 and reports for the
> > remaining comparisons:
> >
> > diff: directory: No such file or directory
>
> Reminds me of bug 79407. I'll have a look at a fix and adding a test.
>
> Here is how it behaved in some older versions vs. current:
>
>     $ mkdir -p directory && touch file{1,2,3} directory/file{1,2,3}
>     $ diff-3.5 --to-file=3Ddirectory file1 file2 file3
>     $ echo $?
>     0
>     $ diff-3.10 --to-file=3Ddirectory file1 file2 file3
>     $ echo $?
>     0
>     $ diff-current --to-file=3Ddirectory file1 file2 file3
>     diff-current: directory: No such file or directory
>     diff-current: directory: No such file or directory
>     2

Here is a test script (attached, also):

  $ cat diff-to_file-test.sh
  #!/bin/sh

  rm -rf -- Dref Da Db Dc  || exit
  mkdir Dref
  echo uno > Dref/f1
  echo dos > Dref/f2
  echo tres > Dref/f3

  # replicate Dref
  for D in Da Db Dc  ;do
    cp -rT -- Dref "$D"
    done

  # add differences
  echo mas >> Db/f1
  echo todo >> Dc/f2

  set -- Da 'identical' Db 'first file different' Dc 'second file different=
'

  while [ 2 -le $# ]  ;do
    echo "=3D=3D=3D $1: $2"
    diff --to-file=3DDref -- "$1"/f1 "$1"/f2 "$1"/f3
    echo "($?)"
    shift  ;shift
    done

  echo '=3D=3D=3D DONE'

A run with the current version:

  $ diff --version  |head -n 2
  diff (GNU diffutils) 3.12
  Packaged by openSUSE
  $ ./diff-to_file-test.sh
  =3D=3D=3D Da: identical
  diff: Dref: No such file or directory
  diff: Dref: No such file or directory
  (2)
  =3D=3D=3D Db: first file different
  2d1
  < mas
  diff: Dref: No such file or directory
  diff: Dref: No such file or directory
  (2)
  =3D=3D=3D Dc: second file different
  diff: Dref: No such file or directory
  diff: Dref: No such file or directory
  (2)
  =3D=3D=3D DONE

An older version with the expected output:

  $ diff --version  |head -n 2
  diff (GNU diffutils) 3.6
  Packaged by openSUSE
  $ ./diff-to_file-test.sh
  =3D=3D=3D Da: identical
  (0)
  =3D=3D=3D Db: first file different
  2d1
  < mas
  (1)
  =3D=3D=3D Dc: second file different
  2d1
  < todo
  (1)
  =3D=3D=3D DONE

--=20
Robert Webb

--000000000000e2e0a60641ca81c0
Content-Type: application/x-shellscript; name="diff-to_file-test.sh"
Content-Disposition: attachment; filename="diff-to_file-test.sh"
Content-Transfer-Encoding: base64
Content-ID: <f_mh2snyne0>
X-Attachment-Id: f_mh2snyne0

IyEvYmluL3NoCiMgYnVnL2RpZmZ1dGlscy9kaWZmLTMuMTItdG8tZmlsZS9kaWZmLXRvX2ZpbGUt
dGVzdC5zaCAgIDIwMjUtMTAtMjIgICBydwoKcm0gLXJmIC0tIERyZWYgRGEgRGIgRGMgIHx8IGV4
aXQKbWtkaXIgRHJlZgplY2hvIHVubyA+IERyZWYvZjEKZWNobyBkb3MgPiBEcmVmL2YyCmVjaG8g
dHJlcyA+IERyZWYvZjMKCiMgcmVwbGljYXRlIERyZWYKZm9yIEQgaW4gRGEgRGIgRGMgIDtkbwog
IGNwIC1yVCAtLSBEcmVmICIkRCIKICBkb25lCgojIGFkZCBkaWZmZXJlbmNlcwplY2hvIG1hcyA+
PiBEYi9mMQplY2hvIHRvZG8gPj4gRGMvZjIKCnNldCAtLSBEYSAnaWRlbnRpY2FsJyBEYiAnZmly
c3QgZmlsZSBkaWZmZXJlbnQnIERjICdzZWNvbmQgZmlsZSBkaWZmZXJlbnQnCgp3aGlsZSBbIDIg
LWxlICQjIF0gIDtkbwogIGVjaG8gIj09PSAkMTogJDIiCiAgZGlmZiAtLXRvLWZpbGU9RHJlZiAt
LSAiJDEiL2YxICIkMSIvZjIgIiQxIi9mMwogIGVjaG8gIigkPykiCiAgc2hpZnQgIDtzaGlmdAog
IGRvbmUKCmVjaG8gJz09PSBET05FJwo=
--000000000000e2e0a60641ca81c0--




From MAILER-DAEMON Fri Oct 24 03:07:05 2025
Received: from list by lists.gnu.org with archive (Exim 4.90_1)
	id 1vCBtA-0004Hu-Qt
	for mharc-bug-diffutils@gnu.org; Fri, 24 Oct 2025 03:07:04 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1vCBt8-00049J-5B
 for bug-diffutils@gnu.org; Fri, 24 Oct 2025 03:07:02 -0400
Received: from debbugs.gnu.org ([2001:470:142:5::43])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1vCBt7-0007qn-RT
 for bug-diffutils@gnu.org; Fri, 24 Oct 2025 03:07:01 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
 d=debbugs.gnu.org; s=debbugs-gnu-org; 
 h=In-Reply-To:From:References:MIME-Version:Date:To:Subject;
 bh=ns9dyPZH+wXNK36MDILXusOGxoTZOw8ywdj56GFOfvE=; 
 b=EKTCJUK/fI6IkepWKZRTg88WLuVTMvLfFPMyGKhxiM6EbPW4rq8n8A2oHRwSpqv8eEijFkh1iqqofMzdQjNiRBJcbdlxELzJxwbr0ApLwlUxt+Iv0nsC7cjrUptQ2UWQEEW/Ok1S6owbtmEy9lkstDxw4A1ExR2GfW7esolY5Oq156AWdXI0diTuNy00Qem91PrnIdCIYUZ39UEvw7n+wHgY0caOeWCWnwot7NVaPWNcm0kWvqCJBN/CTwMXf3t0aPSEzsa0yDD5IfwdLNs+AQ8rW+NaYDDgDQD9Z7zD8NrL4/bAsHLz1yzofQCD2g5BJEQ5iN6kHRO9ZKSzib7VTw==;
Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1vCBt7-0006TX-L8
 for bug-diffutils@gnu.org; Fri, 24 Oct 2025 03:07:01 -0400
X-Loop: help-debbugs@gnu.org
Resent-From: Paul Eggert <eggert@cs.ucla.edu>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: bug-diffutils@gnu.org
Resent-Date: Fri, 24 Oct 2025 07:07:01 +0000
Resent-Message-ID: <handler.79676.B79676.176128961324844@debbugs.gnu.org>
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 79676
X-GNU-PR-Package: diffutils
X-GNU-PR-Keywords: 
To: Collin Funk <collin.funk1@gmail.com>, Santiago Vila <sanvila@debian.org>
Cc: 79676@debbugs.gnu.org, Werner Frey <trollo@franken-online.de>,
 1118586@bugs.debian.org
Received: via spool by 79676-submit@debbugs.gnu.org id=B79676.176128961324844
 (code B ref 79676); Fri, 24 Oct 2025 07:07:01 +0000
Received: (at 79676) by debbugs.gnu.org; 24 Oct 2025 07:06:53 +0000
Received: from localhost ([127.0.0.1]:35064 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1vCBsz-0006Se-4m
 for submit@debbugs.gnu.org; Fri, 24 Oct 2025 03:06:53 -0400
Received: from mail.cs.ucla.edu ([131.179.128.66]:54976)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eggert@cs.ucla.edu>)
 id 1vCBsv-0006S4-Hz
 for 79676@debbugs.gnu.org; Fri, 24 Oct 2025 03:06:50 -0400
Received: from localhost (localhost [127.0.0.1])
 by mail.cs.ucla.edu (Postfix) with ESMTP id D19063C01FA12;
 Fri, 24 Oct 2025 00:06:42 -0700 (PDT)
Received: from mail.cs.ucla.edu ([127.0.0.1])
 by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10032) with ESMTP
 id f0c1oyYrkFAM; Fri, 24 Oct 2025 00:06:42 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1])
 by mail.cs.ucla.edu (Postfix) with ESMTP id A034A3C03E9EE;
 Fri, 24 Oct 2025 00:06:42 -0700 (PDT)
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.cs.ucla.edu A034A3C03E9EE
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.ucla.edu;
 s=9D0B346E-2AEB-11ED-9476-E14B719DCE6C; t=1761289602;
 bh=ns9dyPZH+wXNK36MDILXusOGxoTZOw8ywdj56GFOfvE=;
 h=Message-ID:Date:MIME-Version:To:From;
 b=pnGKWG9RLICF+/V/37Zew1S9q9ZNUABnS539yyDTZ9i8CGqGk9qkyxU2sL+DFQGWk
 Z68NahfY9HUVETZgWGk/OBq53+IosDjqwAvh+lV5zNQRm4JGmjvxYXyEm3pWs2+Shd
 xCFAYt3iRGh0p4fvTkJMu1qj0RKk9W57Q2u0MCDjJFCaBWPmMYiISlMYO+nBKNvxow
 umckkhTKwcJLGjlh+WgXmoDioC5JIUtxACH6/N/HwA7XLraCsxlE7+Kos8/EFosbWP
 tmft0bfpBab7VehDzc9b9Imzq3BmVkIyLeMBrQUCiY3bmVwph5qyE5jyx3hdzL6ysF
 PObPo8FZIslAQ==
X-Virus-Scanned: amavis at mail.cs.ucla.edu
Received: from mail.cs.ucla.edu ([127.0.0.1])
 by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10026) with ESMTP
 id nM27MzqEoMgF; Fri, 24 Oct 2025 00:06:42 -0700 (PDT)
Received: from penguin.cs.ucla.edu
 (47-154-25-30.fdr01.snmn.ca.ip.frontiernet.net [47.154.25.30])
 by mail.cs.ucla.edu (Postfix) with ESMTPSA id 6F2C53C01FA12;
 Fri, 24 Oct 2025 00:06:42 -0700 (PDT)
Message-ID: <b510479d-ef10-406b-8017-01335874edee@cs.ucla.edu>
Date: Fri, 24 Oct 2025 00:06:41 -0700
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
References: <aPjwpiF_C14wxMMW@nuc> <87plae8pff.fsf@gmail.com>
 <87ikg68ixd.fsf@gmail.com>
Content-Language: en-US
From: Paul Eggert <eggert@cs.ucla.edu>
Organization: UCLA Computer Science Department
In-Reply-To: <87ikg68ixd.fsf@gmail.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
Errors-To: debbugs-submit-bounces@debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
X-Spam-Score: -1.0 (-)
Subject: [bug-diffutils] bug#79676: bug#79676: bug#79676:
 [trollo@franken-online.de: Bug#1118586: diffutils: diff --to-file=directory
 no longer works as expected]
X-BeenThere: bug-diffutils@gnu.org
List-Id: "All diffutils discussion." <bug-diffutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-diffutils>,
 <mailto:bug-diffutils-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/bug-diffutils>
List-Post: <mailto:bug-diffutils@gnu.org>
List-Help: <mailto:bug-diffutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-diffutils>,
 <mailto:bug-diffutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 24 Oct 2025 07:07:03 -0000

On 2025-10-22 19:13, Collin Funk wrote:
> The code is quite complex, so I feel like you will have an easier time
> coming up with the correct fix.

I'll try to shake loose some time to look at this, though I'm a bit 
crunched with other stuff.




