git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] date: remove approxidate_relative()

From
Jeff King <peff@peff.net>
Date
Apr 12, 2023, 07:30 UTC
Message-ID
<20230412073001.GA1695531@coredump.intra.peff.net>
In-Reply-To
<xmqqsfd6bf0s.fsf@gitster.g>
On Tue, Apr 11, 2023 at 08:43:47AM -0700, Junio C Hamano wrote:
Show 25 quoted lines
> > 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
Previous: Junio C Hamano
Message 9 of 9 in “date: remove approxidate_relative()”
  1. date: remove approxidate_relative()René Scharfe, Apr 8, 2023
  2. Junio C HamanoApr 10, 2023
  3. Jeff KingApr 10, 2023
  4. René ScharfeApr 10, 2023
  5. Jeff KingApr 11, 2023
  6. Junio C HamanoApr 10, 2023
  7. Jeff KingApr 11, 2023
  8. Junio C HamanoApr 11, 2023
  9. Jeff KingApr 12, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.