From unknown Sat Jun 14 05:13:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#20794: ignore subdirectory with diff Resent-From: "=?UTF-8?Q?=E6=9D=A8=E7=A7=89=E6=AD=A6?=" Original-Sender: "Debbugs-submit" Resent-CC: bug-diffutils@gnu.org Resent-Date: Fri, 12 Jun 2015 15:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 20794 X-GNU-PR-Package: diffutils X-GNU-PR-Keywords: To: 20794@debbugs.gnu.org X-Debbugs-Original-To: bug-diffutils@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.143412303816474 (code B ref -1); Fri, 12 Jun 2015 15:31:02 +0000 Received: (at submit) by debbugs.gnu.org; 12 Jun 2015 15:30:38 +0000 Received: from localhost ([127.0.0.1]:51948 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z3Qug-0004HY-46 for submit@debbugs.gnu.org; Fri, 12 Jun 2015 11:30:35 -0400 Received: from eggs.gnu.org ([208.118.235.92]:39095) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z3K5B-0008QN-Tu for submit@debbugs.gnu.org; Fri, 12 Jun 2015 04:12:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z3K54-0005C1-V8 for submit@debbugs.gnu.org; Fri, 12 Jun 2015 04:12:52 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, HTML_MESSAGE,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:51493) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z3K54-0005Bx-S3 for submit@debbugs.gnu.org; Fri, 12 Jun 2015 04:12:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52596) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z3K52-0000bq-Rd for bug-diffutils@gnu.org; Fri, 12 Jun 2015 04:12:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z3K4y-00059q-Fg for bug-diffutils@gnu.org; Fri, 12 Jun 2015 04:12:48 -0400 Received: from mail-vn0-x230.google.com ([2607:f8b0:400c:c0f::230]:38008) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z3K4y-00059i-9q for bug-diffutils@gnu.org; Fri, 12 Jun 2015 04:12:44 -0400 Received: by vnbf190 with SMTP id f190so4730974vnb.5 for ; Fri, 12 Jun 2015 01:12:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:mime-version:message-id:from:to:subject:content-type; bh=9ix4o3d9WCIw7RfoO2GmGx+pHK6vzsUaUaKXYutjGpk=; b=I8RvWBxMlmxs9uK2o811ojpABagU4sD5hg9v3+aMX2I20pEg5yP1emvRK9fjIHmgg/ W3iajOe75zri05Xybc23ZTD1jQw+alMqjk+WjgiKWT0eTI6a4uK9Vp8Fkf02iqonkl4U ibT+ubf4dg6jri0syJxQKQpCDSjBkC7XbNmsXsyJ/06UGo7gMHTXz7pta+AczRHkoN9O ztcOES8fgz3JcSVlP1ygyGgxm+UNgutqWCoPpMl+zlV6AojUZFquDYQmY2jdEt4P1ja5 pp+M6SjMtxq7Kj1+Ib+I2hb/Wt+2ML6GkqjqsPknGxAZ4yo/TzHJWi51JcmismFVPI/w QEHw== X-Received: by 10.52.75.201 with SMTP id e9mr23572025vdw.33.1434096763382; Fri, 12 Jun 2015 01:12:43 -0700 (PDT) Received: from hedwig-19.prd.orcali.com (ec2-54-85-253-116.compute-1.amazonaws.com. [54.85.253.116]) by mx.google.com with ESMTPSA id p13sm3709323vdj.15.2015.06.12.01.12.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 12 Jun 2015 01:12:42 -0700 (PDT) Date: Fri, 12 Jun 2015 01:12:42 -0700 (PDT) X-Google-Original-Date: Fri, 12 Jun 2015 08:12:41 GMT MIME-Version: 1.0 X-Mailer: Nodemailer (0.5.0; +http://www.nodemailer.com/) Message-Id: <1434096761347.887d9e4f@Nodemailer> X-Orchestra-Oid: 10B94B9A-0D9A-41BE-999E-29D43E944FE3 X-Orchestra-Sig: 31afab12aafae495d903aefdbbfc1fd914c1fdb7 X-Orchestra-Thrid: D8D43D7A-5F0F-4441-9668-359B2A0DC3CA X-Orchestra-Thrid-Sig: 674b9e94035d229e2dabeaf7df022f3c960fbe7c X-Orchestra-Account: 01a669dd3af04c68fce5615de3998c46b9b66402 From: "=?UTF-8?Q?=E6=9D=A8=E7=A7=89=E6=AD=A6?=" Content-Type: multipart/alternative; boundary="----Nodemailer-0.5.0-?=_1-1434096762210" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -4.0 (----) X-Mailman-Approved-At: Fri, 12 Jun 2015 11:30:32 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -4.0 (----) ------Nodemailer-0.5.0-?=_1-1434096762210 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, i want to diff two directory, but ignore subdirectory. For example: i want to compare new directory and old directory, but i want to ignore = old=E2=80=99s a directory. when use the command as follow: diff -Nr --exclude=3Dold/a new old, it will print the difference between = old/a and new But i want to ignore the old/a directory:( The man page tell me =C2=A0=E2=80=94exclude means=C2=A0 When comparing = directories, ignore files and subdirectories whose basenames match = pattern. So it means it cannot ignore subdirectory like aa/bb=3F Guys tell me how to deal with, pleas:) =E2=94=9C=E2=94=80=E2=94=80 new =E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 a =E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 a.txt =E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 b =E2=94=82=C2=A0=C2=A0 =E2=94=94=E2=94=80=E2=94=80 c =E2=94=94=E2=94=80=E2=94=80 old =C2=A0 =C2=A0 =E2=94=9C=E2=94=80=E2=94=80 a =C2=A0 =C2=A0 =E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 1 =C2=A0 =C2=A0 =E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 2 =C2=A0 =C2=A0 =E2=94=82=C2=A0=C2=A0 =E2=94=94=E2=94=80=E2=94=80 3 =C2=A0 =C2=A0 =E2=94=9C=E2=94=80=E2=94=80 a.txt =C2=A0 =C2=A0 =E2=94=9C=E2=94=80=E2=94=80 b =C2=A0 =C2=A0 =E2=94=94=E2=94=80=E2=94=80 c =E2=80=94 Sent from Mailbox ------Nodemailer-0.5.0-?=_1-1434096762210 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
Hi, i want to diff two directory= , but ignore subdirectory.
For example:
i want to compare new directory and old directory, but i want to = ignore old’s a directory.
when use the command as follow:
diff -Nr --exclude=3Dold/a new old, it will print = the difference between old/a and new

But i want to ignore the old/a directory:(
The man page tell me  —exclude = means  When comparing directories, ignore files and subdirectories = whose basenames match pattern.

So it means it cannot ignore subdirectory like aa/bb=3F
Guys tell me how to deal with, pleas:)

├── new
│   ├── a
│   ├── a.txt
│   ├── b
│   └── c
└── old
    ├── a
    │   ├── 1
    │   ├── 2
    │   └── 3
    ├── a.txt
    ├── b
    └── c


Sent from Mailbox
------Nodemailer-0.5.0-?=_1-1434096762210-- From unknown Sat Jun 14 05:13:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#20794: ignore subdirectory with diff References: <1434096761347.887d9e4f@Nodemailer> In-Reply-To: <1434096761347.887d9e4f@Nodemailer> Resent-From: Jeff THUONG Original-Sender: "Debbugs-submit" Resent-CC: bug-diffutils@gnu.org Resent-Date: Tue, 03 Jan 2017 05:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20794 X-GNU-PR-Package: diffutils X-GNU-PR-Keywords: To: 20794@debbugs.gnu.org Received: via spool by 20794-submit@debbugs.gnu.org id=B20794.14834207541880 (code B ref 20794); Tue, 03 Jan 2017 05:20:02 +0000 Received: (at 20794) by debbugs.gnu.org; 3 Jan 2017 05:19:14 +0000 Received: from localhost ([127.0.0.1]:39940 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cOHVC-0000UB-Cw for submit@debbugs.gnu.org; Tue, 03 Jan 2017 00:19:14 -0500 Received: from mail-ua0-f180.google.com ([209.85.217.180]:33161) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cOGKu-00078r-7f for 20794@debbugs.gnu.org; Mon, 02 Jan 2017 23:04:32 -0500 Received: by mail-ua0-f180.google.com with SMTP id i68so209254712uad.0 for <20794@debbugs.gnu.org>; Mon, 02 Jan 2017 20:04:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=LwgRuBugjqt9Ul+BivEy05Qv0kAqx/2LkVmtBpskoYA=; b=t/lvLltrd4dtVqV2JjgoO72l9KO0mrwgOnbc/28k0Xh4/ups8wG+f05ZbOX1z1IJw/ AGY6gbd6X4kqcdD+bgGGQ4gxyD4PxMve8bXc1BaG+MfrGN7gWZYYdzEQcyJE/7buxdHk 8h7R+IfcBoaenjeAzxBRfEDWLjbq9T1yStRSYPlt/80rObwV46fVYW+QuIU0ob7JqRj3 twfyzaK0ihOOndPTYu+rWIA/btAR0X44cMiJ7htcFkYi9Wuqqx79gWB+fUAcSDj7TyZl cN8p1nqs4Z5DzDKJE24N5eoPpaK+TNX68XJ+tELRIBIId1QGOEqSiK2oFghr9p/dmbPW EPOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=LwgRuBugjqt9Ul+BivEy05Qv0kAqx/2LkVmtBpskoYA=; b=rZDFHhgEWQ5cH25jbcCjROPqDTJcdLfJoyVCPRY+X90+PnxMWF/vjKpw6Sy491ZbFl tJxyWnBkr3iKiD3KnfHSuqrKlq4270D1gmmZgWa9TJwvdYPkWZswZieQcSUduE2qW+HS +fhcWlfV3rRgmTSlCKbfUS89PiSNlPLUgw9awHAOVHZYIfyh6bo4Q6phndJcBjnICsjz eInyNXen4KIhcQObkpzXMpV7SwUh8+ckEF87lKFmJEi5deptGAKSpk28oXEo7IAo2+Zk IsZgX5tYGqrjGxleverBVGmBDHfwtbrJAsxo3IroDYBImMBIH+Wt2h9k11OpUfMg25Zz im7A== X-Gm-Message-State: AIkVDXKhV8hlDCC50sVYiXn6cSpJYaET8+EeTagEmm1wyHco3vV0gxTcWuiQ02XOCWUSvVAv1Rtu39os3xNrCQ== X-Received: by 10.159.32.133 with SMTP id 5mr44963330uaa.145.1483416266637; Mon, 02 Jan 2017 20:04:26 -0800 (PST) MIME-Version: 1.0 Received: by 10.176.70.25 with HTTP; Mon, 2 Jan 2017 20:04:06 -0800 (PST) From: Jeff THUONG Date: Tue, 3 Jan 2017 12:04:06 +0800 Message-ID: Content-Type: multipart/alternative; boundary=94eb2c0b6202a087f7054528c32b X-Spam-Score: 0.5 (/) X-Mailman-Approved-At: Tue, 03 Jan 2017 00:19:12 -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: 0.5 (/) --94eb2c0b6202a087f7054528c32b Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 T25lIHdheSB0byBpZ25vcmUgYSBzdWJkaXJlY3RvcnkgaXMgdG8gdXNlICIteCA8c3ViZGlyZWN0 b3J5IG5hbWU+Ig0KDQpJbiB0aGUgZm9sbG93aW5nIGNhc2UsIHlvdSBjb3VsZCB1c2UgIi14IGEi LiBOb3RlIHRoYXQgd291bGQgYWxzbyBpZ25vcmUNCmZpbGVzIG5hbWVkICJhIiBidXQgbm90IGZp bGVzICJhLnR4dCINCg0KDQrilJzilIDilIAgbmV3DQrilIIgICDilJzilIDilIAgYQ0K4pSCICAg 4pSc4pSA4pSAIGEudHh0DQrilIIgICDilJzilIDilIAgYg0K4pSCICAg4pSU4pSA4pSAIGMNCuKU lOKUgOKUgCBvbGQNCiAgICDilJzilIDilIAgYQ0KICAgIOKUgiAgIOKUnOKUgOKUgCAxDQogICAg 4pSCICAg4pSc4pSA4pSAIDINCiAgICDilIIgICDilJTilIDilIAgMw0KICAgIOKUnOKUgOKUgCBh LnR4dA0KICAgIOKUnOKUgOKUgCBiDQogICAg4pSU4pSA4pSAIGMNCg0KDQpJbiBjYXNlIHlvdSB3 YW50IHRvIGlnbm9yZSAiYWEvYmIiIChpLmUuIG5vdCBjb21wYXJpbmcgIm9sZC9hYS9iYiIgYW5k DQoibmV3L2FhL2JiIiksIHlvdSBuZWVkIHRvIHVzZSAiLXggYmIiIHNvIGlmIHlvdSB3YW50ZWQg dG8gc3RpbGwNCmNvbXBhcmUgIm5ldy9jYy9iYiIgYW5kICJvbGQvY2MvYmIiIHlvdSB3b3VsZCBi ZSBvdXQgb2YgbHVjay4NCg== --94eb2c0b6202a087f7054528c32b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
One way to ignore a subdirectory is to use "-x <su= bdirectory name>"

In the following case, you cou= ld use "-x a". Note that would also ignore files named "a&qu= ot; but not files "a.txt"


=E2=94=9C=E2=94=80=E2=94=80 new
=E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 a
=E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 a.txt
=E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 b
=E2=94=82=C2=A0=C2=A0 =E2=94=94=E2=94=80=E2=94=80 c
=E2=94=94=E2=94=80=E2=94=80 old
=C2=A0 =C2=A0 =E2=94=9C=E2=94=80=E2=94=80 a
=C2=A0 =C2=A0 =E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 1
=C2=A0 =C2=A0 =E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 2
=C2=A0 =C2=A0 =E2=94=82=C2=A0=C2=A0 =E2=94=94=E2=94=80=E2=94=80 3
=C2=A0 =C2=A0 =E2=94=9C=E2=94=80=E2=94=80 a.txt
=C2=A0 =C2=A0 =E2=94=9C=E2=94=80=E2=94=80 b
=C2=A0 =C2=A0 =E2=94=94=E2=94=80=E2=94=80 c

In case you want to ignore "aa/bb" =
(i.e. not comparing "old/aa/bb" and "new/aa/bb"), you n=
eed to use "-x bb" so if you wanted to still compare "new/cc=
/bb" and "old/cc/bb" you would be out of luck.

--94eb2c0b6202a087f7054528c32b--