On Tue, Apr 11, 2023 at 08:43:47AM -0700, Junio C Hamano wrote: > > Ooh, I like that very much. In that sense it really feels like an > > extension of --function-context. Would the regexes be searches starting > > from the edge of some context (as they more or less are under the hood > > for function context), or would you search within the whole file for > > ranges (and then presumably use them when a hunk's context is adjacent > > to or overlaps a range)? > > > > If the latter, I guess you could also allow both absolute and relative > > line numbers, similar to how "-L" accepts range input. > > We want the latter. > > If we further imagine that approxidate_careful() were defined very > far away (in either direction) from approxidate_relative() that > "extending" the patch context to show the removal of the latter to > cover the former would show too much irrelevant information, I think > René would have wanted to show a normal patch plus an extra hunk > that contains the entirety of approxidate_careful() that shows no > modification (i.e. all lines are prefixed with an SP). The way I > think about this new "feature" is "compute what hunks should be > shown, honoring all other options. Then pretend no-op hunks to > cover all specified lines in the postimage [*] are also in the > result. Combine them all, ignoring parts of the made-up no-op hunks > when they contradict the real hunks.". The end result should show > all specified lines from the postimage plus the usual diff. Right, that makes perfect sense. Thanks for explaining. Now we just need somebody to implement it. ;) -Peff