Added-support for user-specified mergetool
Also separated out cfg_protect functions into a separate file to lay the groundwork for #310 (closed), but that's a more complicated system and the rest can be tackled later.
Introduces a MERGE_TOOL
configuration variable which it's recommended you set in the global portmod.conf (e.g. in ~/.config/portmod/portmod.conf
). This should specify a shell script which can take two files to be merged as arguments. Note that command line argument can be included with this, but it is executed as {MERGE_TOOL} {new} {original}
. This is probably not a great idea. It might be better to provide a template so that you can do things like kdiff3 {new} {original} --out {merged}
, similarly to git's mergetool configuration. On the other hand vimdiff {new} {original}
could easily just be vimdiff
with the two files passed as arguments, so there the template would be an unnecessary complication. It might be possible to also provide default command patterns for merge tools, but that would require a more complicated configuration.
TODO: Document (since #313 (closed) is on the horizon, I'm tempted to put together the scaffolding for that and document it there rather than document it on the wiki then move it when that's done. Done; and marked in the doc as introduced in portmod 2.3