MCPcopy Index your code
hub / github.com/git/git / get_commit_action

Function get_commit_action

revision.c:4176–4248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4174}
4175
4176enum commit_action get_commit_action(struct rev_info *revs, struct commit *commit)
4177{
4178 if (commit->object.flags & SHOWN)
4179 return commit_ignore;
4180 if (revs->maximal_only && (commit->object.flags & CHILD_VISITED))
4181 return commit_ignore;
4182 if (revs->unpacked && has_object_pack(revs->repo, &commit->object.oid))
4183 return commit_ignore;
4184 if (revs->no_kept_objects) {
4185 if (has_object_kept_pack(revs->repo, &commit->object.oid,
4186 revs->keep_pack_cache_flags))
4187 return commit_ignore;
4188 }
4189 if (commit->object.flags & UNINTERESTING)
4190 return commit_ignore;
4191 if (revs->line_level_traverse && !want_ancestry(revs)) {
4192 /*
4193 * In case of line-level log with parent rewriting
4194 * prepare_revision_walk() already took care of all line-level
4195 * log filtering, and there is nothing left to do here.
4196 *
4197 * If parent rewriting was not requested, then this is the
4198 * place to perform the line-level log filtering. Notably,
4199 * this check, though expensive, must come before the other,
4200 * cheaper filtering conditions, because the tracked line
4201 * ranges must be adjusted even when the commit will end up
4202 * being ignored based on other conditions.
4203 */
4204 if (!line_log_process_ranges_arbitrary_commit(revs, commit))
4205 return commit_ignore;
4206 }
4207 if (revs->min_age != -1 &&
4208 comparison_date(revs, commit) > revs->min_age)
4209 return commit_ignore;
4210 if (revs->max_age_as_filter != -1 &&
4211 comparison_date(revs, commit) < revs->max_age_as_filter)
4212 return commit_ignore;
4213 if (revs->min_parents || (revs->max_parents >= 0)) {
4214 int n = commit_list_count(commit->parents);
4215 if ((n < revs->min_parents) ||
4216 ((revs->max_parents >= 0) && (n > revs->max_parents)))
4217 return commit_ignore;
4218 }
4219 if (!commit_match(commit, revs))
4220 return commit_ignore;
4221 if (revs->prune && revs->dense) {
4222 /* Commit without changes? */
4223 if (commit->object.flags & TREESAME) {
4224 int n;
4225 struct commit_list *p;
4226 /* drop merges unless we want parenthood */
4227 if (!want_ancestry(revs))
4228 return commit_ignore;
4229
4230 if (revs->show_pulls && (commit->object.flags & PULL_MERGE))
4231 return commit_show;
4232
4233 /*

Callers 2

simplify_commitFunction · 0.85
graph_is_interestingFunction · 0.85

Calls 8

has_object_packFunction · 0.85
has_object_kept_packFunction · 0.85
want_ancestryFunction · 0.85
comparison_dateFunction · 0.85
commit_list_countFunction · 0.85
commit_matchFunction · 0.85
relevant_commitFunction · 0.85

Tested by

no test coverage detected