On Wed, Oct 26, 2022 at 1:15 PM Neil Bothwick <[email protected]> wrote: > > On Wed, 26 Oct 2022 10:21:06 -0600, Grant Taylor wrote: > > > > dispatch-conf even gives you the opportunity to edit it before > > > applying. > > > > Yep. > > > > I almost always reject the changes suggested on config files that I've > > modified and accept them on files that I've not modified. > > > > I really do wish that there was a better way to manage this, likely > > involving diffs / deltas. E.g. what changed between the N distribution > > file and the N+1 distribution file. Can that same change be safely > > applied to the N' distribution file to create the N'+1 file? > > conf-update allows you to merge the new and old files, prompting you to > pick which to use on each differing section, with a further option to > edit the lines. That way you can keep your changed lines but still add > lines relating to new config options. >
It could really use an overhaul but cfg-update does 3-way diffs and auto-merges based on them. Ie, if in a block of text you make a change, and in a new update that particular block of text hasn't changed, then your previous change will get auto-merged. If the upstream file changed in that block of text then you can do a 3-way diff. The tool is really old and barely maintained (I'm caretaking it but don't really want to deal with that - patches welcome). It also uses RCS to store the change history for 3-way merging and that could probably be switched to git or something more modern. If you use an x11-based merge tool then it will also refuse to attempt an automatic merge if X11 isn't available. (Obviously you can't actually run the manual merge if the tool uses X11 and that isn't available.) Using it I find that maybe 95% of my config file changes involve no prompts. Another useful tool is etckeeper which is basically just some integrations for portage around maintaining /etc in git. You can of course just do that manually but it will auto-commit changes if you forget to do so before an update. -- Rich

