MCPcopy Create free account
hub / github.com/git/git / diff_tree_combined

Function diff_tree_combined

combine-diff.c:1485–1638  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1483}
1484
1485void diff_tree_combined(const struct object_id *oid,
1486 const struct oid_array *parents,
1487 struct rev_info *rev)
1488{
1489 struct diff_options *opt = &rev->diffopt;
1490 struct diff_options diffopts;
1491 struct combine_diff_path *p, *paths;
1492 int i, num_paths, needsep, show_log_first, num_parent = parents->nr;
1493 int need_generic_pathscan;
1494
1495 if (opt->ignore_regex_nr)
1496 die("combined diff and '%s' cannot be used together",
1497 "--ignore-matching-lines");
1498 if (opt->close_file)
1499 die("combined diff and '%s' cannot be used together",
1500 "--output");
1501
1502 /* nothing to do, if no parents */
1503 if (!num_parent)
1504 return;
1505
1506 show_log_first = !!rev->loginfo && !rev->no_commit_id;
1507 needsep = 0;
1508 if (show_log_first) {
1509 show_log(rev);
1510
1511 if (rev->verbose_header && opt->output_format &&
1512 opt->output_format != DIFF_FORMAT_NO_OUTPUT &&
1513 !commit_format_is_empty(rev->commit_format))
1514 printf("%s%c", diff_line_prefix(opt),
1515 opt->line_termination);
1516 }
1517
1518 diffopts = *opt;
1519 copy_pathspec(&diffopts.pathspec, &opt->pathspec);
1520 diffopts.flags.allow_external = 0;
1521 if (!opt->flags.no_recursive_diff_tree_combined)
1522 diffopts.flags.recursive = 1;
1523
1524 /* find set of paths that everybody touches
1525 *
1526 * NOTE
1527 *
1528 * Diffcore transformations are bound to diff_filespec and logic
1529 * comparing two entries - i.e. they do not apply directly to combine
1530 * diff.
1531 *
1532 * If some of such transformations is requested - we launch generic
1533 * path scanning, which works significantly slower compared to
1534 * simultaneous all-trees-in-one-go scan in find_paths_multitree().
1535 *
1536 * TODO some of the filters could be ported to work on
1537 * combine_diff_paths - i.e. all functionality that skips paths, so in
1538 * theory, we could end up having only multitree path scanning.
1539 *
1540 * NOTE please keep this semantically in sync with diffcore_std()
1541 */
1542 need_generic_pathscan = opt->skip_stat_unmatch ||

Callers 2

diff_tree_combined_mergeFunction · 0.85
builtin_diff_combinedFunction · 0.85

Calls 15

show_logFunction · 0.85
commit_format_is_emptyFunction · 0.85
diff_line_prefixFunction · 0.85
copy_pathspecFunction · 0.85
find_paths_genericFunction · 0.85
find_paths_multitreeFunction · 0.85
combined_objfindFunction · 0.85
diff_tree_oidFunction · 0.85
diffcore_stdFunction · 0.85
diffcore_orderFunction · 0.85
diff_flushFunction · 0.85
order_objectsFunction · 0.85

Tested by

no test coverage detected