So I upgraded an iocage-jail from 13.1->14.0 -- and for some reason freebsd-upgrade had me to manually merge all (or at least most) files in /etc. Mostly it was that it couldn't merge the header of the files or updated commented lines. But for some files there were actually changes but as it was so many files there is a high likelihood that I somewhere lost my sharpness and made mistakes when it came to which files I kept and which I removed. For /etc/defaults/rc.conf there were none of my changes in it from the beginning -- it was just more default lines added that freebsd-update couldn't handle automatically it seems -- and then when I had ot maually merge it I obviously screwed up.
I recall having to do a three-way merge (that's what this process is called in CS terms) once or twice during freebsd-update at $JOB.
But I am not sure how I can reproduce this potential bug when it comes to freebsd-update not being able to automatically handle uncommented lines? Would it be worth to open a PR also then?
Then I have a general question about updating -- if I understand the handbook correctly then etcupdate is only used when updating from source -- is there any way to use it also when not updating from source? The reason I am askin is that 10 years ago when I were running Gentoo Linux I remember that over there it as possible to configure it in a way that it would automatically update all non-edited /etc-files. What is the best practice for doing this in jails in FreeBSD?
Non-edited /etc files are automatically updated by freebsd-update and etcupdate. See my comment about Red Hat below.
Yes, etcupdate is only to be used when updating from source. Back in the day there was mergemaster. It too used the three-way merge algorithm.
The other approach is the one used by Red Hat. They will attempt to replace the file, saving the original as a .RPMSAVE file. Then it's up to you to make sense of the differences. I don't know if they use a three-way merge.
You can play around with three-way diffs using the diff3(1) command. Three-way merge is an industry standard. Subversion, GIT, hg, etcupdate, back in the old days mergemaster, and other tools use three-way merge. The results are "<<<<", "====", and ">>>>" lines. If there are few you're fine. But if there are a ton of them in a file, going through all the "<<<<", "====", and ">>>>" can become confusing after a while. When I become discombobulated I quit and start over again. It's too easy with complex differences to make a mistake.
Before we had Subversion, when we used CVS, we had to do merges by hand. Before mergemaster(1), the precessor to etcupdate(1), sysadmins had to keep track of altered files in /etc and merge them by hand. This was true of the varioius Linuxen at the time too. We've come a long way.