From nobody Tue May 14 20:39:05 2024 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vf7Vy0bmnz5KywD for ; Tue, 14 May 2024 20:39:06 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vf7Vx64Vvz4K1j for ; Tue, 14 May 2024 20:39:05 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715719145; a=rsa-sha256; cv=none; b=FToQ9bcEa8erUub13ySYj45rocqtjuOCL2LvVQRsD4ehMhYCbsq10NJlqCDJOlxSQV7aGa 7zDckWEBdXtckN09eceAMsLHDBCUUyum0h/6D3chgYvzUbq+5vjSmTVoEgUy/CQxx2YYlJ dpWN1d9b5+MT5xbYeSLcOPwQpFQKRuQbTqeqbOBnNUt0Hl6dxyhGmZaqpOAuyrtPS81yPT uw0fM+lJg60qZR8rJHs5M8uRKA1BWC7uGb4JiGeSVS6TTKt4Ac6pllSPd+Ie6moTDbL7A7 g/3eE1mxMLSl9EaGvnHIvMg07LdycXsuZJKb61IuL1Yepg2WZuGgFJizEI4TGA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715719145; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rs9F90igugaPQJOgA5OJRCq4O7GQPuIMtV4SLEyscD4=; b=ydOyHpbLT3gFanYdUrUAS2WqEdJT4KZTsFYS9pKdpbeCVsFqnoYy9mXebm+EDNanuoIbkM 6wUp2cg4cFgTMccmIfBE7sVubFxGhagEipN2Rs5BiD5vNsdXBHEhm/JrEcbSCa3LFg6T8R 8nGCCWjoMKDjQxYr/zfU9S/otVIdT/Ot8zZIwPnYlsOLB5TxAhTcOO8PQ58tXU5RU+HqSR Kz64NHQlKYBTBPmkNhOQWAHq2YPfwaz4SVYYLP6TuYWlrTW0LxRFAnOFRZzLjwODEe0Gwg DFMkploI+Mfr6DX+sJOOU42FdatoYSpO5HnMIBWr+RhyRIvpwvHmfmRwP6/HXw== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vf7Vx5hXVzmb0 for ; Tue, 14 May 2024 20:39:05 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 44EKd5eI032766 for ; Tue, 14 May 2024 20:39:05 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 44EKd5df032765 for bugs@FreeBSD.org; Tue, 14 May 2024 20:39:05 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 278988] diff -B -q: unintuitive or incorrect? Date: Tue, 14 May 2024 20:39:05 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 14.0-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: dhekir@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D278988 Bug ID: 278988 Summary: diff -B -q: unintuitive or incorrect? Product: Base System Version: 14.0-STABLE Hardware: amd64 OS: Any Status: New Severity: Affects Many People Priority: --- Component: bin Assignee: bugs@FreeBSD.org Reporter: dhekir@gmail.com I stumbled upon a very unintuitive behavior of diff: when option -q is used= , -B is ignored, unless it is also accompanied by -b, as in the following exampl= es # create test files: one containing a single newline, another containing 2 newlines $ echo "" > a $ echo -e "\n" > b $ diff a b -B # ok: no diff reported $ diff a b -B -q # weird: -B seems ignored, diff reported (GNU diff does not report it) $ diff a b -b # ok: -b only ignores spaces, not entire lines $ diff a b -b -q # ok: the diff remains, -q does not affect it $ diff a b -B -b -q # ok: this time, -B was taken into account So, we have: 1. -B works on its own; 2. when -B -q is used, -B seems ignored; 3. -b on its own does not suffice to remove the diff in these files 4. -B -b -q works (no diff), but since -b is irrelevant without -q, this se= ems like a bug. In GNU diff, `diff a b -B -q` behaves as what I consider "expected": the fi= les are considered equal. If this is intended behavior, the documentation needs to mention it. Bug #252515 is similar to this one (it mentioned `-w`, while this one menti= ons `-B`). --=20 You are receiving this mail because: You are the assignee for the bug.=