Bug 280434 - diff(1) man-page (and no-param help) documents --ignore-all-blanks but option is named --ignore-all-space
Summary: diff(1) man-page (and no-param help) documents --ignore-all-blanks but option...
Status: Closed FIXED
Alias: None
Product: Documentation
Classification: Unclassified
Component: Manual Pages (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Dag-Erling Smørgrav
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-07-24 23:10 UTC by Tim Chase
Modified: 2024-08-01 16:49 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Chase 2024-07-24 23:10:53 UTC
The man page documents an "--ignore-all-blanks" flag

    $ man diff | ul -t dumb | grep -e '-w.*ignore'
     -w --ignore-all-blanks

as does the help

    $ diff 2>&1 | grep 'ignore-all'
       diff [-aBbditwW] [--expand-tabs] [--ignore-all-blanks]

however there is no --ignore-all-blanks option.  According to the source (usr.bin/diff/diff.c:107) there's an --ignore-all-space option which is the synonym for the -w option (like what the man-page describes).

So the man-page conflicts with the source code (which is also conflicts with itself)


    $ grep ignore-all /usr/src/usr.bin/diff/diff.c
        { "ignore-all-space",           no_argument,            0,      'w' },
            "       diff [-aBbditwW] [--expand-tabs] [--ignore-all-blanks]\n"

FWIW, GNU diff(1) uses --ignore-all-space not --ignore-all-blanks if you're looking for a nudge favoring one vs the other.
Comment 1 commit-hook freebsd_committer freebsd_triage 2024-07-29 14:03:49 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=ab830de9f58c1b257e42b4fbdd46b3ca6a837ee6

commit ab830de9f58c1b257e42b4fbdd46b3ca6a837ee6
Author:     Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2024-07-29 14:02:21 +0000
Commit:     Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2024-07-29 14:02:21 +0000

    diff: Fix usage message and documentation.

    The `--ignore-all-space` option was incorrectly documented as
    `--ignore-all-blanks` in some (but not all) places.

    MFC after:      3 days
    PR:             280434
    Sponsored by:   Klara, Inc.
    Reviewed by:    0mp, markj
    Differential Revision:  https://reviews.freebsd.org/D46160

 usr.bin/diff/diff.1 | 6 +++---
 usr.bin/diff/diff.c | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
Comment 2 commit-hook freebsd_committer freebsd_triage 2024-08-01 16:17:11 UTC
A commit in branch stable/14 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=45fc37334d077d635dbfdd13f5e085513bf09d49

commit 45fc37334d077d635dbfdd13f5e085513bf09d49
Author:     Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2024-07-29 14:02:21 +0000
Commit:     Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2024-08-01 16:15:57 +0000

    diff: Fix usage message and documentation.

    The `--ignore-all-space` option was incorrectly documented as
    `--ignore-all-blanks` in some (but not all) places.

    MFC after:      3 days
    PR:             280434
    Sponsored by:   Klara, Inc.
    Reviewed by:    0mp, markj
    Differential Revision:  https://reviews.freebsd.org/D46160

    (cherry picked from commit ab830de9f58c1b257e42b4fbdd46b3ca6a837ee6)

 usr.bin/diff/diff.1 | 6 +++---
 usr.bin/diff/diff.c | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
Comment 3 commit-hook freebsd_committer freebsd_triage 2024-08-01 16:47:14 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=ae8b85ac11257f1166dfe25c354bf0d4bd64b98d

commit ae8b85ac11257f1166dfe25c354bf0d4bd64b98d
Author:     Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2024-07-29 14:02:21 +0000
Commit:     Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2024-08-01 16:43:02 +0000

    diff: Fix usage message and documentation.

    The `--ignore-all-space` option was incorrectly documented as
    `--ignore-all-blanks` in some (but not all) places.

    MFC after:      3 days
    PR:             280434
    Sponsored by:   Klara, Inc.
    Reviewed by:    0mp, markj
    Differential Revision:  https://reviews.freebsd.org/D46160

    (cherry picked from commit ab830de9f58c1b257e42b4fbdd46b3ca6a837ee6)

 usr.bin/diff/diff.1 | 6 +++---
 usr.bin/diff/diff.c | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)