Skip to main content

Module merge_diff

Module merge_diff 

Source
Expand description

Merge commit and combined (--cc / -c) diff helpers.

These mirror the subset of Git’s combine-diff output needed for porcelain commands (git show, git diff during conflicts, git diff-tree -c).

Functions§

all_blob_paths_in_tree_order
All blob paths in tree_oid, depth-first in Git tree entry order (for diff / log --rotate-to / --skip-to).
blob_oid_at_path
OID of the blob at path in tree.
blob_text_for_diff
Prepare blob bytes for diff: optional textconv when use_textconv and diff=<driver>.
blob_text_for_diff_with_oid
Like blob_text_for_diff, but uses refs/notes/textconv/<driver> when diff.<driver>.cachetextconv is true and blob_oid is known.
combined_diff_paths
Paths that differ between the merge result tree and every parent tree.
combined_merge_parent_blob_paths
Per-parent blob paths for a combined merge path when rename detection is enabled.
convert_blob_to_worktree_for_path
Blob bytes after smudge/EOL conversion for path, using the same rules as checkout.
diff_cachetextconv_enabled
diff_forced_binary_by_driver
Force Binary files ... differ when the path’s diff driver sets binary, except for symlinks.
diff_textconv_active
Returns true when path has a diff=<driver> attribute and diff.<driver>.textconv is set.
diff_textconv_cmd_line
format_combined_binary
Full combined diff for a binary path (two parents).
format_combined_binary_header
Combined diff header: diff --combined or diff --cc.
format_combined_binary_header_n
index line for N-parent combined/binary diffs (p1,p2,...pn..result).
format_combined_textconv_patch
Combined text diff with optional textconv (N parents, single merge path).
format_gitlink_unmerged_conflict_combined
Combined diff --cc for an unmerged gitlink path when stage blobs are absent from the ODB (e.g. t4027 synthetic 1ff… / 2ff… OIDs). Uses full hex in Subproject commit lines like Git.
format_parent_patch
diff --git against parent p for merge commit -m output.
format_worktree_conflict_combined
git diff / git diff --cc during a conflict: worktree file with markers.
is_binary_for_diff
True if diff should treat this path as binary (NUL in blob or -diff / diff=unset).
read_blob_at_path
Read the blob at path in tree, or None if missing.
run_textconv
Run diff.<driver>.textconv feeding input on stdin; returns UTF-8 lossy text on success.
run_textconv_raw
Run diff.<driver>.textconv on input; returns raw stdout on success.