Given a git commit, applies config specified in the commit message.
            Supported:
             - gitlint-ignore: all
16603
def set_config_from_commit(self, commit):
        
        for line in commit.message.body:
            pattern = re.compile(r"^gitlint-ignore:\s*(.*)")
            matches = pattern.match(line)
            if matches and len(matches.groups()) == 1:
                self.set_option('general', 'ignore', matches.group(1))
1040295
def update(self, commit=True, **kwargs):
        

        for (attr, value) in kwargs.iteritems():
            setattr(self, attr, value)
        return commit and self.save() or self
524670
def commit_config(self):
        """"""
        self.device.cu.commit(ignore_warning=self.ignore_warning)
        if not self.config_lock:
            self._unlock()
1190606
def run(self):
        """"""
        if os.system('git add .'):
            sys.exit(1)
        if self.message is not None:
            os.system('git commit -a -m "' + self.message + '"')
        else:
            os.system('git commit -a')
758081
def init_config(options={})
      options = options.to_symbol_keys

      if !options[:method]
        abort "Please provide a deployment method. e.g. #{METHODS.keys}"
      end

      @options = DEFAULT_OPTIONS.deep_merge(options)
      write_config
      check_gitignore
    end
414914
def git_all(*args, git=maybeloggit, **kwargs):
    ''

    try:
        cmd = git(*args, _err_to_out=True, _decode_errors='replace', **kwargs)
        out = cmd.stdout
    except sh.ErrorReturnCode as e:
        status('exit_code=%s' % e.exit_code)
        out = e.stdout

    out = out.decode('utf-8')

    return out
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))
1278893
def commit(context, message, name):
    
    context.obj.find_repo_type()
    if context.obj.vc_name == 'git':
        context.obj.call(['git', 'commit', '-a', '-m', message])
    elif context.obj.vc_name == 'hg':
        context.obj.call(['hg', 'commit', '-m', message])
    if name != '' and context.obj.vc_name == 'git':
        context.obj.call(['git', 'tag', '-a', name, '-m', message])
    elif name != '' and context.obj.vc_name == 'hg':
        context.obj.call(['hg', 'tag', '-m', message, name])
40039
def commit(self, commit):
		
		try:
			return self._commitData(self.repo.get_commit(commit))
		except (ValueError, KeyError, GithubException):
			raise KeyError("Commit %s not found" % commit)
419936
def commit_file(path, message)
      Dir.chdir(@directory) do
        log.debug "committing path #{path} with message: #{message}"
        run("git add #{path}")
        run("git commit --allow-empty -F -", false, message)
      end
    end
665934
def init_config!(config)
      set_internal_config!(config)
      config.each do |(directory, git_repos)|
        git_repos.each do |git_repo|
          git_repo         = git_repo.include?("github.com") ? git_repo : "https://github.com/#{git_repo}.git"
          repo_name        = name_from_git_repo(git_repo)
          repo_path        = File.join(repo_directory_path, directory, repo_name)
          if repos.key? repo_name
            puts "  warning duplicate repo found: #{repo_name.inspect}"
            repos[repo_name] = false
          else
            repos[repo_name] = repo_path
          end
          dirs[repo_path]  = git_repo
        end
      end
    end
747034
function checkCommitMessage (commitMessage, settings) {
  const {
    summaryMaxLength,
    lineMaxLength,
    patterns = {},
    examples = {}
  } = settings

  const isSummaryValid = commitMessage
    ? commitMessage.split('\n')[0].length <= summaryMaxLength
    : true
  const linesExceedingMaxLength = commitMessage
    .split('\n')
    .slice(1) // skip the summary line
    .reduce((a, l, k) => {
      return l.length > lineMaxLength
        ? a.concat({ n: k + 2, text: l })
        : a
    }, [])
  const isLineLengthValid = linesExceedingMaxLength.length === 0
  const isPatternValid = Object.keys(patterns || {}).some(key => {
    return patterns[key].test(commitMessage)
  })

  let errors = []

  if (!isSummaryValid) {
    errors = errors.concat(
      Object.assign(new Error(`Summary is more than ${summaryMaxLength} characters.`), {
        code: 'ESUMRY'
      })
    )
  }

  if (!isLineLengthValid) {
    errors = errors.concat(
      Object.assign(new Error([
        `The following lines have more than ${lineMaxLength} characters :`,
        `${linesExceedingMaxLength.map(l => 'line ' + l.n + ' : ' + l.text).join('\n')}`
      ].join('\n')), { code: 'ELINES', lines: linesExceedingMaxLength })
    )
  }

  if (!isPatternValid) {
    errors = errors.concat(
      Object.assign(new Error([
        'Commit message doesn\'t follow any message pattern.'
      ].concat(
        Object.keys(examples || {})
          .map(key => ['', `${key}:`].concat(examples[key]))
          .reduce((a, b) => a.concat(b), [])
      ).join('\n')), { code: 'EFRMT' })
    )
  }

  return {
    isSummaryValid,
    isLineLengthValid,
    linesExceedingMaxLength,
    isPatternValid,
    isValid: isSummaryValid && isLineLengthValid && isPatternValid,
    errors
  }
}
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);
    }
834707
def add_skip_ci_to_commit_msg(message: str) -> str:
        
        first_line_index = message.find('\n')
        if first_line_index == -1:
            edited_message = message + ' [skip ci]'
        else:
            edited_message = message[:first_line_index] + ' [skip ci]' + message[first_line_index:]
        LOGGER.debug('edited commit message: %s', edited_message)
        return edited_message
629256
function gitCommit () {
      var message = options.message
        .replace(/%sourceName%/g, tokens.name)
        .replace(/%sourceCommit%/g, tokens.commit)
        .replace(/%sourceBranch%/g, tokens.branch);

      // If there are no changes, skip commit
      if (shelljs.exec('git status --porcelain', {silent: true}).output === '') {
        log.subhead('No changes to your branch. Skipping commit.');
        return;
      }

      log.subhead('Committing changes to "' + options.branch + '".');
      execWrap('git add -A .');

      // generate commit message
      var commitFile = 'commitFile-' + crypto.createHash('md5').update(message).digest('hex').substring(0, 6);
      fs.writeFileSync(commitFile, message);

      execWrap('git commit --file=' + commitFile);

      fs.unlinkSync(commitFile);
    }
1070814
function apply_patch(context, patch, tracker) {
	const path = patch[0];
	if (path.length == 0) return; //ignore replace root node
	const value = patch[1];
	const len = path.length - 1;
	const prop = path[len];

	if (!Array.isArray(value)) {
		const node = create_node_by_path(context, path, len, tracker);
		commit_node_prop(context, node, prop, value, tracker);
		return;
	} else {
		const patchType = value[0];

		if (patchType == PatchTypes.DEL) {
			return apply_delete_patch(context, path, tracker);
		}
		const node = create_node_by_path(context, path, len, tracker);
		if (patchType == PatchTypes.REFERENCE) {
			const refNode = create_node_by_path(
				context,
				value[1],
				value[1].length,
				tracker
			);
			commit_node_prop(context, node, prop, refNode, tracker);
			return;
		}

		if (patchType == PatchTypes.NODE) {
			if (
				value[1] == undefined &&
				node_type(node[prop]) == NodeTypes.NODE
				//&& node[prop]._.length == undefined
			) {
				return;
			}

			const childNode = create_node(value[1]);
			commit_node_prop(context, node, prop, childNode, tracker);
			return;
		}
	}
}
1136503
def install_hook(ctx):
    
    try:
        lint_config = ctx.obj[0]
        hooks.GitHookInstaller.install_commit_msg_hook(lint_config)
        # declare victory :-)
        hook_path = hooks.GitHookInstaller.commit_msg_hook_path(lint_config)
        click.echo(u"Successfully installed gitlint commit-msg hook in {0}".format(hook_path))
        ctx.exit(0)
    except hooks.GitHookInstallerError as e:
        click.echo(ustr(e), err=True)
        ctx.exit(GIT_CONTEXT_ERROR_CODE)