Skip to main content

Module userdiff

Module userdiff 

Source
Expand description

User-defined and built-in diff function-name matching.

This module implements the subset of Git’s userdiff behavior needed for hunk-header function context extraction.

Structs§

FuncnameMatcher
Compiled function-name matcher used for diff hunk headers.

Constants§

GIT_WORD_REGEX_DEFAULT_SUFFIX
Default word-regex suffix Git appends for built-in drivers (userdiff.c PATTERNS macro).
GIT_WORD_REGEX_FALLBACK
Built-in extended word regex when no driver matches (Git userdiff “default” driver).

Functions§

builtin_word_regex
Returns the driver-specific word-regex pattern fragment plus whether it uses REG_ICASE.
matcher_for_driver
Resolve a function-name matcher for a named diff driver.
matcher_for_path
Resolve a function-name matcher for rel_path from attributes + config.
matcher_for_path_parsed
Like matcher_for_path but uses parsed .gitattributes rules from crate::attributes.
word_regex_pattern_for_path_parsed
Effective word-diff regular expression for rel_path (Git diff.wordRegex + driver + builtins).