From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 15 19:21:05 2021 Received: (at submit) by debbugs.gnu.org; 16 Feb 2021 00:21:05 +0000 Received: from localhost ([127.0.0.1]:38936 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lBo6y-00022i-Gw for submit@debbugs.gnu.org; Mon, 15 Feb 2021 19:21:05 -0500 Received: from lists.gnu.org ([209.51.188.17]:35544) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lBlra-0006mv-1k for submit@debbugs.gnu.org; Mon, 15 Feb 2021 16:57:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57372) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBlrZ-0006Hm-PS for bug-diffutils@gnu.org; Mon, 15 Feb 2021 16:57:01 -0500 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]:46790) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lBlrY-0007Qp-Cc for bug-diffutils@gnu.org; Mon, 15 Feb 2021 16:57:01 -0500 Received: by mail-ej1-x62c.google.com with SMTP id y26so13540715eju.13 for ; Mon, 15 Feb 2021 13:56:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=Z2iY7OI/HgGOjJ4ra9PapI6SH5b28h+XmP3ihTSKGgk=; b=Lbe1L81w9DjXZ9sphde2fPixnEWxlFQK1nuJlbqxKNrzA/7Xvdqnpo4qfO6sIcWu0i JfEMKS9eq0juk5WNQFcRPbTrqNCXk7vOy4hsQjzPS/yYdr+3VujBZhfVCTFdjMZn/yJk UXVHyxDPxkxGg/1G9AtZYSTDnGKBNyYgVuKMuNb3cqRuctQ2wV0j+h8gQo017BVJGYhb UC7Lkj6RUEWKVGRJDKbiHPA219EzpBA7Iby0Zdq63pdH6sm6wQ2bRXZI6jYyMAIkHBkx b/806Ww6Y2WzDqPUhwNn/yT5sRGNS/sEQJ7M9o/VTLOzWFfEFVL3ZtaCnUFysUe+OogD qlAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=Z2iY7OI/HgGOjJ4ra9PapI6SH5b28h+XmP3ihTSKGgk=; b=Ak/k2slx3gJ22TgOJCkwNEOxW+blHskZhXkA++o/i1lZ3wOkOqfzWrHfe8rSJFSs3p vM+AULfeZALoi8hv2FxXnwU8sQwRuPiMh8B256ZpcbEkyTfIM6PUNDW8MuGqT547M+wo aRj+L0thblP/L40BoR7lLSPf5rX2AlIxkipAldWziHChDEhwmU2kXUAiJdRm3djNYIr6 87JbJDAjfNpYa7r9ngniWXmzDVaZ2pPD6oMy6cOw01oV5roTaO+r+flkFEKEfoxLxnTK rWbUM/PnVyqWkzAwnf1Y04Atl6I1WutSkApAIGq8z77Av1cn1StMaaY0TLjAlTiWhVA+ Ij/g== X-Gm-Message-State: AOAM531HxLLVsiG0Gf90t9/fnQL8ha072pJ4augOJBJ6jxbwMqvFqFu/ rqS44omAhYEyOnlBrJiFNuDJvXSqm2ajAw== X-Google-Smtp-Source: ABdhPJw7b1VosAFdSWCAALZgVeMwCowpS/HSAgkn8kYIRkGCfucy894ThV372FPCiGl6rhsT3jzQPQ== X-Received: by 2002:a17:907:2d93:: with SMTP id gt19mr17212586ejc.246.1613426218570; Mon, 15 Feb 2021 13:56:58 -0800 (PST) Received: from ?IPv6:2a01:c22:ccc7:be00:e9a7:3bc5:4bc5:6a41? (dynamic-2a01-0c22-ccc7-be00-e9a7-3bc5-4bc5-6a41.c22.pool.telefonica.de. [2a01:c22:ccc7:be00:e9a7:3bc5:4bc5:6a41]) by smtp.gmail.com with ESMTPSA id q14sm11224595edw.52.2021.02.15.13.56.57 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 15 Feb 2021 13:56:57 -0800 (PST) To: bug-diffutils@gnu.org From: Stan Schymanski Subject: bug in diff -r? Message-ID: <2da62b93-31fd-5584-010f-c67ce23fa577@gmail.com> Date: Mon, 15 Feb 2021 22:56:38 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=2a00:1450:4864:20::62c; envelope-from=schymans@gmail.com; helo=mail-ej1-x62c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Mon, 15 Feb 2021 19:21:03 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Dear all, I cannot get diff -r to search recursively. Here is an example. First I create two folders, each with one sub-folder and one file, where each sub-folder and file has a different content: ``` $ mkdir orig $ mkdir backup $ mkdir orig/1 $ mkdir backup/2 $ echo 'blah' > orig/1/test.txt $ ls orig/1 test.txt $ echo 'blah1' > backup/2/test1.txt ``` Now I compare them using the '-qr' option: ``` $ diff -qr orig/ backup/ Only in orig/: 1 Only in backup/: 2 ``` I was expecting to be told that orig/1/test.txt and backup/2/test1.txt are unique. If I descend into the subfolder in one of them, the file in that folder is found: ``` $ diff -r orig/1 backup/ Only in backup/: 2 Only in orig/1: test.txt ``` I actually get the same behaviour with or without '-qr'. Is this a bug or am I misunderstanding diff -r? I am using diff (GNU diffutils) 3.7. Cheers Stan From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 16 12:22:33 2021 Received: (at 46550) by debbugs.gnu.org; 16 Feb 2021 17:22:33 +0000 Received: from localhost ([127.0.0.1]:41462 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lC43V-0007J1-Fy for submit@debbugs.gnu.org; Tue, 16 Feb 2021 12:22:33 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:38046) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lC43S-0007Im-Qs for 46550@debbugs.gnu.org; Tue, 16 Feb 2021 12:22:31 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id B80891600CD; Tue, 16 Feb 2021 09:22:24 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id Ed0UijzT3nGA; Tue, 16 Feb 2021 09:22:24 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 5AA8C1600BE; Tue, 16 Feb 2021 09:22:23 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id nyVHHcSrh34Q; Tue, 16 Feb 2021 09:22:23 -0800 (PST) Received: from [192.168.1.9] (cpe-23-243-218-95.socal.res.rr.com [23.243.218.95]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 33FFD1600A7; Tue, 16 Feb 2021 09:22:23 -0800 (PST) Subject: Re: [bug-diffutils] bug#46550: bug in diff -r? To: Stan Schymanski , 46550@debbugs.gnu.org References: <2da62b93-31fd-5584-010f-c67ce23fa577@gmail.com> From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: Date: Tue, 16 Feb 2021 09:22:22 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <2da62b93-31fd-5584-010f-c67ce23fa577@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 46550 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On 2/15/21 1:56 PM, Stan Schymanski wrote: > Is this a bug > or am I misunderstanding diff -r? Perhaps a bit of both. The algorithm you want (which is to pretend that directories missing in A are empty in B, and vice versa) is not the algorithm that 'diff -r A B' uses.