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
Taylor Blau <me@ttaylorr.com>
Date
Feb 5, 2021, 20:05 UTC
Message-ID
<YB2lHmLxe8ArFz0v@nand.local>
In-Reply-To
<xmqqtuqr2uz3.fsf@gitster.c.googlers.com>
On Thu, Feb 04, 2021 at 04:56:16PM -0800, Junio C Hamano wrote:
Show 20 quoted lines
> > I'd add an additional use-case, which is ignoring new commits from
> > upstream when displaying a range-diff in rerolled patch series.
> >
> > Oftentimes I'll find that the automatically-prepared range diff that
> > 'git format-patch --cover-letter --range-diff' generates will include
> > new commits from upstream, so these new options should help me ignore
> > those in the output.
>
> Do you mean that the new round is based on an updated upstream
> commit, while the old series was based on a bit older upstream?
> After rebasing your topic, "range-diff @{1}..." would find the
> updates in the base (made in the upstream) plus the new round of
> your work on the right hand side of the symmetric range, while the
> left hand side solely consists of your old round (unless the
> upstream rewound their work, which should not happen).  But that
> must not be it, I guess, because in such a case, among the commits
> in @{1}..HEAD, we cannot (eh, at least range-diff cannot) tell which
> one came from upstream and which one came from our fingers.
>
> So I am a bit puzzled there.

I'm talking about a situation where a later re-roll is based of of a newer upstream. But your judgement is right: upstream's updates look like "new" commits on the right-hand side.

I have some scripts built around this, but they all boil down to passing '--range-diff=@{1}' (where @{1} is the tip of the previous reroll) to format-patch. See:

    https://github.com/ttaylorr/dotfiles/blob/work-gh/bin/git-mail#L8-L10
for details.

IIUC this series, I think I'd also want to start passing '--left-only' to ignore the new commits from upstream in a range-diff, no?

Thanks, Taylor

Previous: Johannes SchindelinNext: Johannes Schindelin via GitGitGadget
Message 15 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.