diff options
| author | Junio C Hamano <gitster@pobox.com> | 2026-04-07 14:59:27 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-04-07 14:59:27 -0700 |
| commit | 1678b7de977043f31242d2029259797eee620236 (patch) | |
| tree | 749d1f5c103743b03ab9862d34e104deae16f397 /diffcore.h | |
| parent | fb5516997ef3f882d8e53ce70ba6077533683621 (diff) | |
| parent | 512536a09ea2964e93226f219898ee0a09d85a70 (diff) | |
| download | git-1678b7de977043f31242d2029259797eee620236.tar.xz | |
Merge branch 'mm/line-log-use-standard-diff-output'
The way the "git log -L<range>:<file>" feature is bolted onto the
log/diff machinery is being reworked a bit to make the feature
compatible with more diff options, like -S/G.
* mm/line-log-use-standard-diff-output:
doc: note that -L supports patch formatting and pickaxe options
t4211: add tests for -L with standard diff options
line-log: route -L output through the standard diff pipeline
line-log: fix crash when combined with pickaxe options
Diffstat (limited to 'diffcore.h')
| -rw-r--r-- | diffcore.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/diffcore.h b/diffcore.h index 9c0a0e7aaf..d75038d1b3 100644 --- a/diffcore.h +++ b/diffcore.h @@ -19,6 +19,17 @@ struct userdiff_driver; * in anything else. */ +/* A range [start, end). Lines are numbered starting at 0. */ +struct range { + long start, end; +}; + +/* A set of ranges. The ranges must always be disjoint and sorted. */ +struct range_set { + unsigned int alloc, nr; + struct range *ranges; +}; + /* We internally use unsigned short as the score value, * and rely on an int capable to hold 32-bits. -B can take * -Bmerge_score/break_score format and the two scores are @@ -106,6 +117,11 @@ int diff_filespec_is_binary(struct repository *, struct diff_filespec *); struct diff_filepair { struct diff_filespec *one; struct diff_filespec *two; + /* + * Tracked line ranges for -L filtering; borrowed from + * line_log_data and must not be freed. + */ + const struct range_set *line_ranges; unsigned short int score; char status; /* M C R A D U etc. (see Documentation/diff-format.adoc or DIFF_STATUS_* in diff.h) */ unsigned broken_pair : 1; |
