Lines Matching refs:commit

18 clang-format on the changes in current files or a specific commit.               
35 usage = 'git clang-format [OPTIONS] [<commit>] [--] [<file>...]'
39 and <commit>, which defaults to HEAD. Changes are only applied to the working
44 clangFormat.commit
89 p.add_argument('--commit',
90 default=config.get('clangformat.commit', 'HEAD'),
91 help='default commit to use if none is specified'),
111 # to use some heuristics to determine whether or not <commit> was present.
113 p.add_argument('args', nargs='*', metavar='<commit>',
122 commit, files = interpret_args(opts.args, dash_dash, opts.commit)
123 changed_lines = compute_diff_and_extract_lines(commit, files)
183 """Interpret `args` as "[commit] [--] [files...]" and return (commit, files).
189 left (if present) is taken as commit. Otherwise, the first argument is
190 checked if it is a commit or a file. If commit is not given,
194 commit = default_commit
196 die('at most one commit allowed; %d given' % len(args))
198 commit = args[0]
199 object_type = get_object_type(commit)
200 if object_type not in ('commit', 'tag'):
202 die("'%s' is not a commit" % commit)
204 die("'%s' is a %s, but a commit was expected" % (commit, object_type))
208 commit = args[0]
211 commit = default_commit
214 commit = default_commit
216 return commit, files
221 # If `value` is ambiguous (neither a commit nor a file), the following
227 if object_type in ('commit', 'tag'):
229 die('`%s` is a %s, but a commit or filename was expected' %
244 def compute_diff_and_extract_lines(commit, files):
246 diff_process = compute_diff(commit, files)
256 def compute_diff(commit, files):
257 """Return a subprocess object producing the diff from `commit`.
260 differences between the working directory and `commit`, filtered on `files`
262 cmd = ['git', 'diff-index', '-p', '-U0', commit, '--']
436 print >>sys.stderr, 'Please commit, stage, or stash them first.'