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§

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.
convert_blob_to_worktree_for_path
Blob bytes after smudge/EOL conversion for path, using the same rules as checkout.
diff_cachetextconv_enabled
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_textconv_patch
Combined text diff with textconv (two parents, single-file focus).
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.