Skip to main content

Module diff

Module diff 

Source
Expand description

Unified diff generation with color support.

This module provides utilities for generating standard unified diff format output, detecting when to use colors (respecting NO_COLOR and TTY detection), and applying colors to deletions/additions following git’s convention (red for removed, green for added).

Functions§

format_colored_diff
Formats a colored diff between two strings.
format_diff_summary
Generates a git-style summary header for a diff.
format_unified_diff
Generates a unified diff between two strings.
should_use_color
Determines whether colored output should be used.