Created attachment 220823 [details] mergemaster run with -FU still prompting to update the same file mergemaster(8) has -F option which allows you to merge the files if the file header has updated or changed. Git doesn't do ident tag expansion so in file header you have now only $FreeBSD$. When both -FU options are used, mergemaster prompts only to merge when the header is different. When the header is in svn style, after updating the ident tag mergemaster doesn't ask again for updating the same file in second and subsequent runs. The transition to git has broken this feature and mergemaster prompts for the merge or update also in second and subsequent runs. Please compare the attached script.
I looked at this for a bit, and this is kind of gross behavior on mergemaster's part and not specific to -F: https://cgit.freebsd.org/src/tree/usr.sbin/mergemaster/mergemaster.sh#n1122 says: case "${STRICT}" in '' | [Nn][Oo]) # Compare $Id's first so if the file hasn't been modified # local changes will be ignored. # If the files have the same $Id, delete the one in temproot so the # user will have less to wade through if files are left to merge by hand. # ID1=`grep "[$]${ID_TAG}:" ${DESTDIR}${COMPFILE#.} 2>/dev/null` ID2=`grep "[$]${ID_TAG}:" ${COMPFILE} 2>/dev/null` || ID2=none case "${ID2}" in "${ID1}") echo " *** Temp ${COMPFILE} and installed have the same Id, deleting" rm "${COMPFILE}" ;; esac ;; esac So if the ident tag was expanded and it matched, mergemaster would assume no changes to the file and discard the new version. I suspect this is a WONTFIX situation, unfortunately.
(In reply to Kyle Evans from comment #1) The behavior is less gross than I stated in that comment, but I did weird stuff here where strict would've been a better default.
The behaviour of mergemaster is fine. The drawback is that you need to reserve a lot more time to update config files with mergemaser and the option -F became useless.
Created attachment 220827 [details] Ugly hack for mergemaster(8) to workaround Id removal With this patch running "mergemaster -UFi" is even riskier than before, but some might like it. Perhaps the right solution is not to workaround this but to add a new option like -T to replace -F to mergemaster(8).
Created attachment 220828 [details] Still uggly but better suited workaround Better suited patch, still a workaround.
(In reply to Marek Zarychta from comment #5) I blindly assumed that timestamps in TEMPROOT dir will be preserved but it's completely wrong assumption making this workaround useless. The files are not just copied or installed but make(1) is involved in TEMPROOT setup.
People these times do not update their OSes from the sources. It's probably high time to deprecated this old method from the previous century and transition to freebsd-update(8).
(In reply to Marek Zarychta from comment #7) freebsd-update use is not viable for some platforms/contexts. There are also folks that work on updating FreeBSD beyond what freebsd-update has available at the time (updates will become available later). Getting build-from-source to have zero use is problematical.
The project can utilise gitatributes(5) to support ident as $Id:$ in Git. The specific files or directories could have it enabled and probably both: mergemaster(8) and etcupdate(8) after small rework can fully utilise it. The comment #7 suggests that updating from sources is still viable so I reopen it.
(In reply to Marek Zarychta from comment #7) freebsd-update does not support -STABLE.
(In reply to Thierry Thomas from comment #10) Yes, I closed the bug with this comment. But comment #8 says that not everyone is willing to use only freebsd-update to update the system, so the bug got reopened.
(In reply to Marek Zarychta from comment #11) freebsd-update is not available for many (all?) of our tier-2 architectures.
There's a very real chance that mergemaster could just get deprecated here instead. As I mentioned on IRC, you should give etcupdate a shot.
(In reply to Kyle Evans from comment #13) I'm not aware of documentation of the equivalents for etcupdate use to the standard documentation's use of specific mergemaster commands for variations of the source based update sequence, such as in /usr/src/Makefile : . . . # 5. `reboot' (in single user mode: boot -s from the loader prompt). # 6. `mergemaster -p' # 7. `make installworld' # 8. `mergemaster' (you may wish to use -i, along with -U or -F). . . . or on the COMMON ITEMS in UPDATING.
(In reply to Kyle Evans from comment #13) If mergemaster(8) gets deprecated then people would say goodbye to it and will struggle with etcupdate(8). Mergemaster does the merge side by side, etcupdate adds "<<<<<<<<<<<<<<<" ">>>>>>>>>>>>>>" to merged files and you have to edit them manually also taking care of these ">>>>>>>>>>>>>>" marks. Is it that big effort to add ident among other gitattributes(5) to have $Is$ tags to this part of sources? They are only needed for the files mergemaster or etcupdate has to cope with. When it's done both tools can be patched manually by FreeBSD enduser if he would care. Even if mergemaster gets deprecated and removed from the base such ident tags in config files will be helpful. How without them would non-committers who update their repositories only occasionally would figure out that the file has changed?
There are no plans to support ident $Id$, as implemented in git - it is official information. So kevans@ is right that it is a WONTFIX situation. mergemaster is still able to do the job and doesn't have to be deprecated due to this breakage. I have submitted this PR but I think it is time to close it definitely, not look back, enjoy and celebrate the transition to the git repo.