Bug 225762 - diff truncate function name with --show-function-line
Summary: diff truncate function name with --show-function-line
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-bugs (Nobody)
Keywords: easy, feature
Depends on:
Reported: 2018-02-08 16:10 UTC by Zsolt Udvari
Modified: 2020-07-07 21:20 UTC (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Zsolt Udvari 2018-02-08 16:10:59 UTC
I noticed that diff truncates the "function name" if using -F (--show-function-line) option. I think this problem is similar to this stackoverflow question: https://stackoverflow.com/questions/11232461/unix-diff-show-function-line-truncates-output
Are any reason to truncate or can enlarge it (or maybe user-definied with an option)?
Comment 1 fehmi noyan isi 2020-06-13 13:38:24 UTC
BSD diff(1) does not -F/--show-function-line option. This bug report GNU diff, which is available in ports now.
Comment 2 Zsolt Udvari 2020-06-22 18:01:23 UTC
$ man /usr/share/man/man1/diff.1.gz | grep -- -F
       -F RE  --show-function-line=RE
       N      number of lines = L-F+1
$ freebsd-version 

As I see the man page in FreeBSD 11.3 and 11.4 contains it:

But the 12.0 doens't:
Comment 3 fehmi noyan isi 2020-07-07 21:20:00 UTC
Yes, that's correct but this also supports my previous comment. 

The BSD licensed diff utility was imported from OpenBSD with 11.2-RELEASE and there have been a few addition/improvements since then. 

The manual page you display for 11.3-RELEASE and 11.4-RELEASE are for GNU diff utility (see the copyright section at the bottom of the manual pages). 

I could not find it in the 12.0-RELEASE notes but I would assume the default diff utility was replaced with the BSD diff(1) in 12.0-RELEASE (needs confirmation).

After all, the current diff(1) utility in base is the modified/improved version of the diff program imported from OpenBSD. 

At the moment, diff(1) does not implement -F/--show-function-line options. You may want to request somebody to close this bug report and open a new one to request -F/--show-function-line support to diff(1).

If you open a new bug report, it may be worthwhile to add it to this one.