Lines Matching full:commits
38 If zero or one commits are given, run clang-format on all lines that differ
42 If two commits are given (requires --diff), run clang-format on all lines in the
129 commits, files = interpret_args(opts.args, dash_dash, opts.commit)
130 if len(commits) > 1:
132 die('--diff is required when two commits are given')
134 if len(commits) > 2:
135 die('at most two commits allowed; %d given' % len(commits))
136 changed_lines = compute_diff_and_extract_lines(commits, files)
156 if len(commits) > 1:
157 old_tree = commits[1]
159 revision=commits[1],
203 """Interpret `args` as "[commits] [--] [files]" and return (commits, files).
209 left (if present) are taken as commits. Otherwise, the arguments are checked
210 from left to right if they are commits or files. If commits are not given,
214 commits = [default_commit]
216 commits = args
217 for commit in commits:
226 commits = []
230 commits.append(args.pop(0))
231 if not commits:
232 commits = [default_commit]
235 commits = [default_commit]
237 return commits, files
265 def compute_diff_and_extract_lines(commits, files): argument
267 diff_process = compute_diff(commits, files)
277 def compute_diff(commits, files): argument
278 """Return a subprocess object producing the diff from `commits`.
282 one was specified, or the difference between both specified commits, filtered
285 if len(commits) > 1:
287 cmd = ['git', git_tool, '-p', '-U0'] + commits + ['--']