Manage git config for a repository or globally.

    + key: the key of the config to ensure
    + value: the value this key should have
    + repo: specify the git repo path to edit local config (defaults to global)
970094
def config(
    state, host, key, value,
    repo=None,
):
    '''
    
    '''

    existing_config = host.fact.git_config(repo)

    if key not in existing_config or existing_config[key] != value:
        if repo is None:
            yield 'git config --global {0} "{1}"'.format(key, value)
        else:
            yield 'cd {0} && git config --local {1} "{2}"'.format(repo, key, value)
927035
def set_value(ctx, key, value):
    
    scrubbing = False
    if value is None:
        scrubbing = key in SECRET_KEYS
        value = click.prompt('Value for `{}`'.format(key), hide_input=scrubbing)

    if key in ('core', 'extras', 'agent') and not value.startswith('~'):
        value = os.path.abspath(value)

    user_config = new_config = ctx.obj
    user_config.pop('repo_choice', None)

    data = [value]
    data.extend(reversed(key.split('.')))
    key = data.pop()
    value = data.pop()

    # Use a separate mapping to show only what has changed in the end
    branch_config_root = branch_config = {}

    # Consider dots as keys
    while data:
        default_branch = {value: ''}
        branch_config[key] = default_branch
        branch_config = branch_config[key]

        new_value = new_config.get(key)
        if not hasattr(new_value, 'get'):
            new_value = default_branch

        new_config[key] = new_value
        new_config = new_config[key]

        key = value
        value = data.pop()

    value = string_to_toml_type(value)
    branch_config[key] = new_config[key] = value

    save_config(user_config)

    output_config = scrub_secrets(branch_config_root) if scrubbing else branch_config_root
    echo_success('New setting:')
    echo_info(toml.dumps(output_config).rstrip())
51218
function remoteSetup() {
			var link = '${GH_TOKEN}@' + options.gitHostname + '/' + commit.slug + '.git';
			cmd('git config --global user.email "' + options.repoEmail + '"');
			cmd('git config --global user.name "' + options.repoUser + '"');
			cmd('git remote rm ' + options.repoName);
			cmd('git remote add ' + options.repoName + ' https://' + commit.username + ':' + link);
		}
223156
def _set_key(self, key, value):
        

        if is_config_section(value):
            self.add_section(key, value)
            return

        if key not in self._tree or self.settings.key_setter is None:
            if is_config_item(value):
                self.add_item(key, value)
                return

            raise TypeError(
                'Section sections/items can only be replaced with sections/items, '
                'got {type}. To set value use ..[{name}].value = <new_value>'.format(
                    type=type(value),
                    name=key,
                )
            )

        if self.settings.key_setter is None:
            self._default_key_setter(key, value)
        else:
            self.settings.key_setter(subject=self._tree[key], value=value, default_key_setter=self._default_key_setter)
759942
def config_amend_key_(self,key,value):
        
        cfg_i = self._cfg
        keys = key.split('.')
        last_key = keys.pop()
        trail = []
        for e in keys:
            cfg_i.setdefault(e,{})
            cfg_i = cfg_i[e]
            trail.append(e)
            if not isinstance(cfg_i,dict):
                raise Exception('.'.join(trail) + ' has conflicting dict/scalar types!')
        cfg_i.setdefault(last_key,value)
342608
def user_config(**kwargs):
    
    for kw in kwargs:
        git('config --global user.%s "%s"' %(kw, kwargs.get(kw))).wait()
1340026
def _make_git(config_info):
    """"""
    git_args = {}

    def _add_value(value, key):
        args_key, args_value = _GIT_ARG_FNS[key](value)
        git_args[args_key] = args_value

    devpipeline_core.toolsupport.args_builder("git", config_info, _GIT_ARGS, _add_value)
    if git_args.get("uri"):
        return devpipeline_scm.make_simple_scm(Git(git_args), config_info)
    else:
        raise Exception("No git uri ({})".format(config_info.config.name))
1050339
public function set($configOption, $configValue)
    {
        $this->repository->git(sprintf('config --local %s %s', $configOption, $configValue));
        unset($this->configuration[$configOption]);
    }
172681
def set_config(self, key, option, value):
        """"""
        if '_config' not in self.proxy:
            newopt = dict(default_cfg)
            newopt[option] = value
            self.proxy['_config'] = {key: newopt}
        else:
            if key in self.proxy['_config']:
                self.proxy['_config'][key][option] = value
            else:
                newopt = dict(default_cfg)
                newopt[option] = value
                self.proxy['_config'][key] = newopt
333865
def set(self, key, value):
        
        # the configuration changes, so we invalidate the cached config
        self._full_config = None
        self._override[key] = value
949840
def set(self, section, option, value=''):
        '''
        
        '''
        self._string_check(value)
        super(GitConfigParser, self).set(section, option, value)
703165
def config(key, value, local=True):
    
    option = local and '--local' or ''
    run('config %s "%s" "%s"' % (option, key, value))
1099971
def in_config(self, key):
        
        # if the requested key is an alias, then return the proper key
        key = self._real_key(key)

        exists = self._config.get(key)
        return exists
1204543
def init(path = Dir.pwd, _options = {})
      # FIXME: for travis test: ensure the global git configurations
      # 'user.email' and 'user.name' are set
      [ 'user.name', 'user.email' ].each do |userconf|
        next unless MiniGit[userconf].nil?
        warn "The Git global configuration '#{userconf}' is not set so"
        warn "you should *seriously* consider setting them by running\n\t git config --global #{userconf} 'your_#{userconf.sub(/\./, '_')}'"
        default_val = ENV['USER']
        default_val += '@domain.org' if userconf =~ /email/
        warn "Now putting a default value '#{default_val}' you could change later on"
        run %(
                       git config --global #{userconf} "#{default_val}"
                  )
        #MiniGit[userconf] = default_val
      end
      exit_status = 1
      Dir.mkdir( path ) unless Dir.exist?( path )
      Dir.chdir( path ) do
        execute "git init" unless FalkorLib.config.debug
        exit_status = $?.to_i
      end
      # #puts "#init #{path}"
      # Dir.chdir( "#{path}" ) do
      #     %x[ pwd && git init ] unless FalkorLib.config.debug
      # end
      exit_status
    end
431177
def set_config(self, key, value):
        

        keyname = "config:" + key

        self.kvstore.set(keyname, value)
1358888
private void gitSetConfig(final String name, String value)
            throws MojoFailureException, CommandLineException {
        if (value == null || value.isEmpty()) {
            value = "\"\"";
        }

        // ignore error exit codes
        executeGitCommandExitCode("config", name, value);
    }
841995
def setConfigKey(key, value):
		
		configFile = ConfigurationManager._configFile()
		return JsonDataManager(configFile).setKey(key, value)