On Mon, Aug 21, 2023 at 09:21:50AM -0700, Junio C Hamano wrote: > Many callers of run_diff_index() passed literal "1" for the option > flag word, which should better be spelled out as DIFF_INDEX_CACHED > for readablity. Everybody else passes "0" that can stay as-is. > > The other bit in the option flag word is DIFF_INDEX_MERGE_BASE, but > curiously there is only one caller that can pass it, which is "git > diff-index --merge-base" itself---no internal callers uses the > feature. > > A bit tricky call to the function is in builtin/submodule--helper.c > where the .cached member in a private struct is set/reset as a plain > Boolean flag, which happens to be "1" and happens to match the value > of DIFF_INDEX_CACHED. Good catch. I guess this is conversion that should have been done in 4c3fe82ef1 (diff-lib: accept option flags in run_diff_index(), 2020-09-20). That commit did fix up some callers, but missed these ones. While this is conceptually orthogonal to what I'm looking at in the other part of the thread, the textual conflicts are really annoying. I'm going to float this to the front of my series and build on top. -Peff