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)
URL:
Keywords: easy, feature
Depends on:
Blocks:
 
Reported: 2018-02-08 16:10 UTC by Zsolt Udvari
Modified: 2020-07-07 21:20 UTC (History)
1 user (show)

See Also:


Attachments

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 
11.3-RELEASE-p9


As I see the man page in FreeBSD 11.3 and 11.4 contains it:
https://www.freebsd.org/cgi/man.cgi?query=diff&apropos=0&sektion=0&manpath=FreeBSD+11.3-RELEASE&arch=default&format=html

But the 12.0 doens't:
https://www.freebsd.org/cgi/man.cgi?query=diff&apropos=0&sektion=0&manpath=FreeBSD+12.0-RELEASE&arch=default&format=html
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.