From owner-freebsd-hackers@freebsd.org Wed May 27 08:52:49 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 77BE232C60C for ; Wed, 27 May 2020 08:52:49 +0000 (UTC) (envelope-from fnoyanisi@yahoo.com) Received: from sonic303-1.consmr.mail.bf2.yahoo.com (sonic303-1.consmr.mail.bf2.yahoo.com [74.6.131.40]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49X4NJ5RcNz3ySh for ; Wed, 27 May 2020 08:52:48 +0000 (UTC) (envelope-from fnoyanisi@yahoo.com) X-YMail-OSG: 8AzakfgVM1k79VtzZ7.Q6Niffg_kCyprTZ.TPg9nU87diBM3cUNQNzspNp4tpjU hHxTwrEAH506irZcMSBiLtgFlPgUWzfyMDwh5ZD8.GCGWhkzM7qowtVW8b4LhyBF5oI.JFPRmyzD o7rAX1JHvOa5IdW6NLVE7jZ1w1AN8vJPyd7djkEh42RANfl0bcMxBqnFncU38GIeQ9jPV577ybix RusYC4OO6kCmeFgid4IvpxT2YDssa32LSlFrHGPi0Xqg6hvpV_bQdlpFYSaCk3heNPBDkYjscCMQ oLqUByPw1GFqzvPf62yxw56Rs76CqprT9KimRhQsQw0Cv9S19f9s4GA_c9ok.lkKPHn2nWGE1qsY SNDzXxHhs2J.9l8xzBWBvK3b0tY5t6Cn2ug0ZbKSK7ZdhNZ0Vlr6tlnxmZU3.cDcmv0nc33lhIXN WdIbK6p.eEr4rRXYvu9p9IC4Wwuh5vUCiCDsfTKNXg_PpjrOWhcnvu1LOUpboeaoTs9C54WCBm.a Um7ZPxxjlzpwe6MsIoNOkW99UsBwpZe60.WHgudfF2pgnBlJLmWQTvI3MIbyhI9.4orAMDa0QMPy rSHZCqFE.tzYEZtffBtW1I.cNTRXO4hU98DnSWWX3IAyUR7VoZc.fV.Pci.kcm1eRnZM.wcDwFVe dvou.A7iBtswb2YVEZJAbn2hJpe9Z_.hH_47WJcOZxA70ZrxpxGKiKMFRUsjDW2hOmYC8Ob_vIDc 01WgPNPrGoFlveBGER2M_5CNVt9mRDKufiBTO2SYmxgQQEzUiSwvIH7vQXdHIc8m10Y0WWn8R79K Uu5bTSTY9zBtjRSSN3RwwVztf4CimvQ0HFsj2By66dKTH_nlxHNVLoRqftifRV8GJW2Bf4e4WA97 V6KO8zBHh7s_YzwLJ66pximYY_IEJrgSE81_cuPaPIfQCnVNEcX.tEcVgdtdVTpMUvlSmWx8QQib Il7cGNZeyn_.haO8D1E1UGnSjnFPGRtr4YnBLdohH5QPKz6nYmZ5Zx.n2nlWL2f8XfHhJk3tuV5A rychxVLN9KX1RrnQjGNZx8RnwsPkD1hyHD1828p4feHcFPFpCdlxVnOBTSNSx96cYfhg4Pybaco1 piUPItpjH6Pie4h_HJ4RUWkVjQWtmir862T8Z7QePpk43Z6FIsUcji5TkRqU3hBsbsC3wJm5VqqD qN4QdZQn1bi4MPmnmklPuQKVIw2mwLdO4ubFzfRDsu9GsOKztyXE0S9kgj3d7XQpCVbYMVvZZTsF FOiNptUwjkNU7n3boY2be5L9E7CbKhGZ0H56MpWrMCQEXaQFd1Ka4Xp7x10.1nht2USU67QCy3.G P064qYJfDGgaiqMe7uMt8pivJuhTQ9C03TZDFHGWDg2b0uAiuIIcyu4rI1US9NSQSopyBjMu7KJg zaeVe9c7I Received: from sonic.gate.mail.ne1.yahoo.com by sonic303.consmr.mail.bf2.yahoo.com with HTTP; Wed, 27 May 2020 08:52:47 +0000 Received: by smtp406.mail.gq1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID cb3865b9c5732162197b90bb7e4e3f31; Wed, 27 May 2020 08:52:43 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: diff(1) -N behaviour - Bug 233402 From: Fehmi Noyan ISI In-Reply-To: Date: Wed, 27 May 2020 20:52:38 +1200 Cc: freebsd-hackers@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <0E0FB885-5D64-41F1-9A8B-8CEDB5884762@yahoo.com> References: <94a82a22-b5c9-b797-30cc-0242f6da1c8a@fastmail.com> <4ADEBC26-0F93-45C1-B775-E6E33E95FDC1@yahoo.com> To: Yuri Pankov X-Mailer: Apple Mail (2.3608.80.23.2.2) X-Rspamd-Queue-Id: 49X4NJ5RcNz3ySh X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.44 / 15.00]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[yahoo.com]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; DKIM_TRACE(0.00)[yahoo.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; NEURAL_HAM_SHORT(-0.93)[-0.931]; FREEMAIL_TO(0.00)[fastmail.com]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:26101, ipnet:74.6.128.0/21, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.02)[-1.025]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-0.99)[-0.986]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[74.6.131.40:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[74.6.131.40:from]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 May 2020 08:52:49 -0000 > On 23/05/2020, at 11:47 PM, Yuri Pankov wrote: >=20 > Fehmi Noyan ISI via freebsd-hackers wrote: >>> On 23/05/2020, at 11:21 PM, Yuri Pankov = wrote: >>>=20 >>> Fehmi Noyan ISI via freebsd-hackers wrote: >>>> Hiya >>>> Apparently, after we switched from GNU diff to BSD diff, the -N = flag no longer assumes absent files as empty. >>>> There is a bug report about GNU diff compatibility but when I look = at diff(1) man page, I see that not treating absent files as empty is = intentional rather than a missing functionality. >>>> If this is not the case, I can work on patch to match to GNU diff = behaviour, otherwise, this bug report can be closed I think. >>>> What=E2=80=99s your take on this? >>>> -N --new-file >>>> If a file is found in only one directory, act as if it was = found >>>> in the other directory too but was of zero size. >>>> man for GNU diff >>>> -N, --new-file >>>> treat absent files as empty >>>=20 >>> I think both descriptions say the same, i.e. "zero size" =3D=3D = "empty=E2=80=9D? >> Maybe it=E2=80=99s my interpretation, but if you do not supply the = second argument to diff(1), it complains >> $ echo =E2=80=9Ctest=E2=80=9D > a.txt >> $ diff -N a.txt nofile >> diff: nofile: No such file or directory >> $ >> GNU diff assumes an empty file for the missing second file and makes = the comparison >> $ echo =E2=80=9Ctest=E2=80=9D > a.txt >> $ diff -N a.txt nofile >> 1d0 >> < test >> $ >=20 > I must admit that I never used -N without -r, so it's probably the = only case that needs fixing? >=20 > $ mkdir a b > $ echo bar > a/foo > $ diff -ruN a b > diff -ruN a/foo b/foo > --- a/foo 2020-05-23 14:44:34.525932000 +0300 > +++ b/foo 1970-01-01 03:00:00.000000000 +0300 > @@ -1 +0,0 @@ > -bar >=20 Took me a while to reply=E2=80=A6 With -N, GNU diff does not give an ENOENT % echo foo > bar % diff bar nofile.txt diff: nofile.txt no such file or directory % diff -N bar nofile.txt 1d0 < foo Do we want BSD diff do the same, i.e. match the -N functionality of GNU = diff? Fehmi