From owner-freebsd-questions@freebsd.org Sun Dec 22 19:19:31 2019 Return-Path: Delivered-To: freebsd-questions@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 9C61E1DA5BB for ; Sun, 22 Dec 2019 19:19:31 +0000 (UTC) (envelope-from ml@netfence.it) Received: from soth.netfence.it (net-2-44-121-52.cust.vodafonedsl.it [2.44.121.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mailserver.netfence.it", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47gsjt45bJz3FL2 for ; Sun, 22 Dec 2019 19:19:30 +0000 (UTC) (envelope-from ml@netfence.it) Received: from alamar.ventu (alamar.local.netfence.it [10.1.2.18]) (authenticated bits=0) by soth.netfence.it (8.15.2/8.15.2) with ESMTPSA id xBMJJH1v087951 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO) for ; Sun, 22 Dec 2019 20:19:19 +0100 (CET) (envelope-from ml@netfence.it) X-Authentication-Warning: soth.netfence.it: Host alamar.local.netfence.it [10.1.2.18] claimed to be alamar.ventu From: Andrea Venturoli Subject: Some comments about /usr/bin/diff To: freebsd-questions@freebsd.org Message-ID: <5ced220c-257d-280c-6c9a-7bd3242c40d8@netfence.it> Date: Sun, 22 Dec 2019 20:19:16 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.3.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 47gsjt45bJz3FL2 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=pass (policy=none) header.from=netfence.it; spf=pass (mx1.freebsd.org: domain of ml@netfence.it designates 2.44.121.52 as permitted sender) smtp.mailfrom=ml@netfence.it X-Spamd-Result: default: False [-4.14 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:2.44.121.52]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; HAS_XAW(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_NONE(0.00)[]; DMARC_POLICY_ALLOW(-0.50)[netfence.it,none]; IP_SCORE(-1.34)[ip: (-7.07), ipnet: 2.44.0.0/16(-3.53), asn: 30722(3.85), country: IT(0.03)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:30722, ipnet:2.44.0.0/16, country:IT]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Dec 2019 19:19:31 -0000 Hello. (I hope this is not considered ranting; I'm not used to it and I'm trying to be constructive...) I recently upgraded a box from 11.3 to 12.1 and I see diff has changed a lot: IIUIC on 11.3 I had GNU diff (possibly from /usr/src/contrib/diff?), while on 12.1 I have a different version (I believe it's BSD diff, from /usr/src/usr.bin/diff). I don't believe this change comes from some local settings of mine, but I didn't see it mentioned in the release notes (either for 12.0 or 12.1). I think I know the reasons behind this (licenses) and I understand it: only, if I had known, I wouldn't have lost almost one day after a script that used to work before. But lets move away from this... 11.3's diff used to have a -y/--side-by-side option (which showed the two file on two columns); this is now gone. Shouldn't this be considered a regression? Finally, in a task of mine I often have to "diff -rq" two directories which have ~75000 files; those files are usually very similar, with a only a few lines differing. Some of them have up to 25M lines. 11.3 takes under 7 minutes to perform the task, while I had to interupt 12.1 after a few hours and I have no idea how far it got. After some "gdb"ugging, I see 12.1 gets stuck when it arrives at a big multi-million lines file: my guess is that 11.3 sees one line is different, outputs the result and moves on to the next file, while 12.1 will (try to) compute the full difference as if "-q" was not given. Persnoally, I would call this a bug. Of course an easy solution is to install textproc/diffutils and change "diff" to "gdiff". I know the rule: if you don't like this, go ahead and submit patches, but I'm not up to it (at least not now). I'm just hoping that reading this will ease it for others who might fall in the same pitfall. bye av.