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)?
BSD diff(1) does not -F/--show-function-line option. This bug report GNU diff, which is available in ports now.
$ 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
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.
This is a gnu-diff bug. FreeBSD deleted gnu-diff in 2017 in a17665bcefb6b60d8dfb5ae95d9dfce6a3ca79c7 or r317209. This bug can be closed.
We now have -F in main, by the way. It's not great but it seems to work.