Support a plain text settings file
The proposed method of exporting TortoiseGit settings is:
If you want to export all your client settings to use on another computer you can do so using the Windows registry editor regedt32.exe. Go to the registry key HKCU\Software\TortoiseGit and export it to a reg file. On the other computer, just import that file again (usually, a double click on the reg file will do that).
Unfortunately, in general it may not be so simple:
- There are some values which should probably never be shared between different TortoiseGit installations, e.g. CurrentVersion.
- There are some values which you may not want to share between installations, e.g. those beneath the subkey HKEY_CURRENT_USER\SOFTWARE\TortoiseGit\History if you have one installation at home and one at work.
- Some values will only be created when you change the configuration to be different then the default. E.g., a new installation will not have any values for context menu configuration. If you would use a .reg file on another new installation, that would not be a problem. But if the other installation would already have values for non-default configuration, you would not overwrite the non-default configuration with the default configuration by importing a .reg file.
Thus, you must carefully pick all the values you want to share. If you want to share default values, you must first deviate from the default values so that the values will be saved to the registry and then revert back to the default values, which will then be saved to the registry as well.
There are ways to work around these issues, and the article presents one, but they are all prone to be somewhat cryptic and brittle:
- Some values that are conceptually not numerical are represented numerically. E.g., the context menu entries are conceptually a
Map<ContextMenuEntryEnum, Boolean>
orMap<String, Boolean>
, but are represented asPair<Integer, Integer>
, namely with the registry valuesContextMenuEntries
andContextMenuEntrieshigh
. (using pseudocode) - There is no gurantee that any workaround will be compatible with future versions of TortoiseGit, because the registry keys and values it uses do not constitute a public API and could thus be subject to changes anytime.
Thus, it would be helpful if TortoiseGit had a plain text settings file that honored backwards-compatibility. A YAML file would probably be most convenient, but JSONC (JSON with comments), XML or INI would also be fine.
Users could then share/sync/version-control this file via a cloud/network drive or a GitHub repository.
If this is too much work, it would be helpful if you could make and document any guarantees about registry keys and their values. Then it would be easier to implement custom scripts/tools.