Lines Matching defs:commits
40 If zero or one commits are given, run clang-format on all lines that differ
54 If two commits are given (requires --diff), run clang-format on all lines in the
203 "diff from the last common commit for commits in "
205 "commits"
228 commits, files = interpret_args(opts.args, dash_dash, opts.commit)
229 if len(commits) > 2:
230 die("at most two commits allowed; %d given" % len(commits))
231 if len(commits) == 2:
233 die("--staged is not allowed when two commits are given")
235 die("--diff is required when two commits are given")
238 "--diff_from_common_commit is only allowed when two commits are "
246 commits, files, opts.staged, opts.diff_from_common_commit
275 if len(commits) > 1:
276 old_tree = commits[1]
336 """Interpret `args` as "[commits] [--] [files]" and return (commits, files).
342 left (if present) are taken as commits. Otherwise, the arguments are
343 checked from left to right if they are commits or files. If commits are not
347 commits = [default_commit]
349 commits = args
350 for commit in commits:
362 commits = []
366 commits.append(args.pop(0))
367 if not commits:
368 commits = [default_commit]
371 commits = [default_commit]
373 return commits, files
403 def compute_diff_and_extract_lines(commits, files, staged, diff_common_commit):
405 diff_process = compute_diff(commits, files, staged, diff_common_commit)
415 def compute_diff(commits, files, staged, diff_common_commit):
416 """Return a subprocess object producing the diff from `commits`.
421 both specified commits, filtered on `files` (if non-empty).
425 if len(commits) == 2:
428 commits = [f"{commits[0]}...{commits[1]}"]
432 cmd = ["git", git_tool, "-p", "-U0"] + extra_args + commits + ["--"]