Skip to main content

Module git_program_settings

Module git_program_settings 

Source
Expand description

The git settings that name a program, taken from the environment for a host agent in a folder a container agent can write.

In such a folder (mcp_folder_rule) the folder’s own .git/config is not the person’s: a container agent can write it, and a plain git status by the host agent runs what it names. Git reads configuration from the environment (GIT_CONFIG_COUNT, GIT_CONFIG_KEY_<n>, GIT_CONFIG_VALUE_<n>) after every file, so the settings below are given there, by the same entries as core.hooksPath (publish_guard), with a value that runs nothing of the folder’s. For the settings a person chooses for themselves (their ssh command, their signing programs, their editors) the value is the one git gives from the person’s system and global configuration alone, and the neutral value is used only when neither sets one: the folder’s value is never used. Every other agent’s git is left as it is.

What is set, checked against git 2.52 (a value is read the last one wins, except core.gitProxy, where the first wins, so that one is set by its own variable):

  • core.sshCommand (ssh), core.editor and sequence.editor (true), gpg.program and gpg.openpgp.program (gpg), gpg.ssh.program (ssh-keygen), gpg.x509.program (gpgsm), gpg.ssh.defaultKeyCommand (true): the person’s own value, else the one in brackets;
  • core.fsmonitor false, core.pager cat, pager.<command> false for every git command (a pager the folder names for one command, such as pager.log, takes precedence over core.pager), core.askPass empty (no program asked, no fallback to SSH_ASKPASS);
  • protocol.ext.allow never: the folder’s remote cannot name a command (ext::) to run;
  • credential.helper empty, first of the entries, which clears every helper the files named, so the helpers the environment lists after it (the GitHub broker’s, under credential.<url>.helper) are the only ones; a credential.helper the environment itself lists is left;
  • GIT_PROXY_COMMAND empty (no proxy command), unless the environment already has a value.

Constants§

META_KEY_PTYSHELL_GIT_PROGRAM_SETTINGS
The meta key of a shell pane of such an agent that says its git is given entries_over.

Functions§

apply_for_spawn
The spawn environment of an agent whose pane has block_meta: given the settings when it is a host agent in a folder the rule holds for, and left as it is otherwise.
entries_over
The variables that give git the settings above, on top of the entries get already sees; own is persons_values.
persons_values
The person’s own value (lower-cased name to value) for each of [PERSONS] that their system or global git configuration sets, read outside any repository: what git gives with no folder’s configuration. Kept for a short while, so a start of several agents asks git once.