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

Re: [PATCH 0/6] Optionally restrict range-diff output to "left" or "right" range only

From
Jeff King <peff@peff.net>
Date
Feb 5, 2021, 10:11 UTC
Message-ID
<YB0Z5JXbe22ko2Mj@coredump.intra.peff.net>
In-Reply-To
<xmqqtuqr2uz3.fsf@gitster.c.googlers.com>
On Thu, Feb 04, 2021 at 04:56:16PM -0800, Junio C Hamano wrote:
Show 13 quoted lines
> > As an aside: I am curious if I'm missing something when you say the
> > "only way" is to ask for a 'git range-diff ...@{u}'. IIUC what you're
> > describing, I often resort to using 'git cherry' for that exact thing.
> > But, I may not be quite understanding your use-case (and why git-cherry
> > doesn't do what you want already).
> >
> > My latter question is purely for satisfying my own curiosity; I don't
> > have any problem with a '--{left,right}-only' option in range-diff. From
> > my quick read of the patches, it all looks pretty sane to me.
> 
> The question is addressed to Dscho, and I am also somewhat curious.
> Perhaps the reason would be that the output from cherry is not as
> easy to read as range-diff, without any post-processing.

I had the same curiosity; I'd use git-cherry (or rev-list --cherry) for this.

I suspect the big difference is the quality of the matching. git-cherry is purely looking at patch-ids. So it is quite likely to say "this was not applied upstream" when what got applied differed slightly (e.g., fixups upstream, applied to a different base, etc). Whereas range-diff has some cost heuristics for deciding that two patches are basically the same thing. So it would find more cases (and as a bonus, give you the diff to see what tweaks were made upstream).

It does make me wonder if it would be useful for rev-list, etc to have an option to make "--cherry" use the more clever heuristics instead of just a patch-id. It would never show the same diff output as range-diff, but maybe more scripts would find the advanced heuristic useful.

I know it would probably make rebase's "ignore if in upstream" feature less clunky when I rebase topics. But it would also make it more dangerous! E.g., right now I see any upstream tweaks as potential conflicts when I rebase, and I manually review them for sanity.

-Peff
Previous: Junio C HamanoNext: Johannes Schindelin
Message 13 of 22 in “Optionally restrict range-diff output to "left" or "right" range only”
  1. 0/6 Optionally restrict range-diff output to "left" or "right" range onlyJohannes Schindelin via GitGitGadget, Feb 4, 2021
  2. 3/6 range-diff: simplify code spawning `git log`Johannes Schindelin via GitGitGadget, Feb 4, 2021
  3. 1/6 range-diff: avoid leaking memory in two error code pathsJohannes Schindelin via GitGitGadget, Feb 4, 2021
  4. 2/6 range-diff: libify the read_patches() function againJohannes Schindelin via GitGitGadget, Feb 4, 2021
  5. 4/6 range-diff: combine all options in a single data structureJohannes Schindelin via GitGitGadget, Feb 4, 2021
  6. Eric SunshineFeb 4, 2021
  7. Johannes SchindelinFeb 5, 2021
  8. 6/6 range-diff: offer --left-only/--right-only optionsJohannes Schindelin via GitGitGadget, Feb 4, 2021
  9. 5/6 range-diff: move the diffopt initialization down one layerJohannes Schindelin via GitGitGadget, Feb 4, 2021
  10. Junio C HamanoFeb 4, 2021
  11. Taylor BlauFeb 4, 2021
  12. Junio C HamanoFeb 5, 2021
  13. Jeff KingFeb 5, 2021
  14. Johannes SchindelinFeb 8, 2021
  15. Taylor BlauFeb 5, 2021
  16. 0/6 Optionally restrict range-diff output to "left" or "right" range onlyJohannes Schindelin via GitGitGadget, Feb 5, 2021
  17. 3/6 range-diff: simplify code spawning `git log`Johannes Schindelin via GitGitGadget, Feb 5, 2021
  18. 5/6 range-diff: move the diffopt initialization down one layerJohannes Schindelin via GitGitGadget, Feb 5, 2021
  19. 2/6 range-diff: libify the read_patches() function againJohannes Schindelin via GitGitGadget, Feb 5, 2021
  20. 6/6 range-diff: offer --left-only/--right-only optionsJohannes Schindelin via GitGitGadget, Feb 5, 2021
  21. 1/6 range-diff: avoid leaking memory in two error code pathsJohannes Schindelin via GitGitGadget, Feb 5, 2021
  22. 4/6 range-diff: combine all options in a single data structureJohannes Schindelin via GitGitGadget, Feb 5, 2021

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.