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

Re: [PATCH] xdiff/xpatience: support anchoring line(s)

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 23, 2017, 02:47 UTC
Message-ID
<xmqqh8tlr9sp.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<xmqq3755sprp.fsf@gitster.mtv.corp.google.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 15 quoted lines
> What do we do when
>
>     git diff --histogram --patience
>
> is given?  Do we warn?  If we don't, perhaps it may not be too bad
> if 
>
>     git diff --histogram --patience-anchor=foo
>     git diff --patience-anchor=foo --histogram
>
> did not get any warning.  Instead we just implicitly turn any
> occurence of --patience-anchor=foo into --patience followed by the
> same option, and assume that the user wanted the usual "last one
> wins" semantics.  It would turn patience on for the former, and
> ignore the anchor for the latter and use historgram.

Thinking about this a bit more, I do like the basic idea of the UI even better. What we could do is to sell this to the end users as a new kind of diff algorithm choice (i.e. myers, patience, ... will gain a new friend) that internally happens to be implemented by piggybacking on patience (just like minimal is piggybacking on myers) and call it "anchor". Then just like this command line

    git diff --histogram --patience

makes the last one win without complaint, it is sane that these command lines

    git diff --histogram --anchored=<pattern>
    git diff --anchored=<pattern> --histogram
make the last one win without complaint, either.
Hmm?
Previous: Junio C HamanoNext: Jonathan Tan
Message 8 of 15 in “xdiff/xpatience: support anchoring a line”
  1. xdiff/xpatience: support anchoring a lineJonathan Tan, Nov 21, 2017
  2. Stefan BellerNov 21, 2017
  3. Junio C HamanoNov 22, 2017
  4. xdiff/xpatience: support anchoring line(s)Jonathan Tan, Nov 22, 2017
  5. Stefan BellerNov 23, 2017
  6. Junio C HamanoNov 23, 2017
  7. Junio C HamanoNov 23, 2017
  8. Junio C HamanoNov 23, 2017
  9. Jonathan TanNov 27, 2017
  10. diff: support anchoring line(s)Jonathan Tan, Nov 27, 2017
  11. Junio C HamanoNov 28, 2017
  12. diff: support anchoring line(s)Jonathan Tan, Nov 28, 2017
  13. Johannes SchindelinNov 30, 2017
  14. Jonathan TanNov 30, 2017
  15. Stefan BellerDec 4, 2017

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.