diff options
| author | Ezekiel Newren <ezekielnewren@gmail.com> | 2025-09-26 22:41:58 +0000 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-10-03 10:19:40 -0700 |
| commit | e385e1b7d2d7f531a0006131e7f1d974de351df5 (patch) | |
| tree | 17a83cb37af1ffcea91a5dd7272a1761733a7948 /builtin/count-objects.c | |
| parent | b7de64a6d6f58953a0c1dc7ff34f7080b3e38b37 (diff) | |
xdiff: add macros DISCARD(0), KEEP(1), INVESTIGATE(2) in xprepare.c
This commit is refactor-only; no behavior is changed. A future commit
will use bool literals for changed[i].
The functions xdl_clean_mmatch() and xdl_cleanup_records() will be
cleaned up more in a future patch series. The changes to
xdl_cleanup_records(), in this patch, are just to make it clear why
`char rchg` is refactored to `bool changed`.
Rename dis* to action* and replace literal numericals with macros.
The old names came from when dis* (which I think was short for discard)
was treated like a boolean, but over time it grew into a ternary state
machine. The result was confusing because dis* and rchg* both used 0/1
values with different meanings.
The new names and macros make the states explicit. nm is short for
number of matches, and mlim is a heuristic limit:
nm == 0 -> action[i] = DISCARD -> changed[i] = true
0 < nm < mlim -> action[i] = KEEP -> changed[i] = false
nm >= mlim -> action[i] = INVESTIGATE -> changed[i] = xdl_clean_mmatch()
When need_min is true, only DISCARD and KEEP occur because the limit
is effectively infinite.
Best-viewed-with: --color-words
Signed-off-by: Ezekiel Newren <ezekielnewren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/count-objects.c')
0 files changed, 0 insertions, 0 deletions
