datalad_next.annexremotes.SpecialRemote

class datalad_next.annexremotes.SpecialRemote(annex)[source]

Bases: SpecialRemote

Base class of all datalad-next git-annex special remotes

get_remote_gitcfg(remotetypename: str, name: str, default: Any | None = None, **kwargs)[source]

Get a particular Git configuration item for the special remote

This target configuration here is not the git-annex native special remote configuration that is provided or altered with initremote and enableremote, and is committed to the git-annex branch. Instead this is a clone and remote specific configuration, declared in Git's configuration system.

The configuration items queried have the naming scheme:

remote.<remotename>.<remotetypename>-<name>
datalad.<remotetypename>.<name>

where <remotename> is the name of the Git remote, the special remote is operating under, <remotetypename> is the name of the special remote implementation (e.g., uncurl), and <name> is the name of a particular configuration flavor.

Parameters:
  • remotetypename (str) -- Name of the special remote implementation configuration is requested for.

  • name (str) -- The name of the "naked" configuration item, without any sub/sections. Must be a valid git-config variable name, i.e., case-insensitive, only alphanumeric characters and -, and must start with an alphabetic character.

  • default -- A default value to be returned if there is no configuration.

  • **kwargs -- Passed on to datalad_next.config.ConfigManager.get()

Returns:

If a remote-specific configuration exists, it is reported. Otherwise a remote-type specific configuration is reported, or the default provided with the method call, if no configuration is found at all.

Return type:

Any

property remotename: str

Name of the (git) remote the special remote is operating under

property repo: LeanAnnexRepo

Returns a representation of the underlying git-annex repository

An instance of LeanAnnexRepo is returned, which intentionally provides a restricted API only. In order to limit further proliferation of the AnnexRepo API.