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

Re: [PATCH v3] rebase --merge: optionally skip upstreamed commits

From
Derrick Stolee <stolee@gmail.com>
Date
Mar 31, 2020, 11:55 UTC
Message-ID
<f6f93f52-cb7a-f2cb-aa21-51b98044b654@gmail.com>
In-Reply-To
<20200330165705.134447-1-jonathantanmy@google.com>
On 3/30/2020 12:57 PM, Jonathan Tan wrote:
Show 11 quoted lines
>>> Add a flag to "git rebase" to allow suppression of this feature. This
>>> flag only works when using the "merge" backend.
>>
>> So this is the behavior that already exists, and you are providing a way
>> to suppress it. However, you also change the default in this patch, which
>> may surprise users expecting this behavior to continue.
> 
> First of all, thanks for looking at this.
> 
> I'm not changing the default - was there anything in the commit message
> that made you believe it? If yes, I could change it.

It's not your fault. My confusion is all. You make it very clear, but I got flipped around several times while reading the patch. Here is your message again:

Show 12 quoted lines
> When rebasing against an upstream that has had many commits since the
> original branch was created:
> 
>  O -- O -- ... -- O -- O (upstream)
>   \
>    -- O (my-dev-branch)
> 
> it must read the contents of every novel upstream commit, in addition to
> the tip of the upstream and the merge base, because "git rebase"
> attempts to exclude commits that are duplicates of upstream ones. This
> can be a significant performance hit, especially in a partial clone,
> wherein a read of an object may end up being a fetch.

So by default, it "attempts to exclude commits that are duplicates of upstream ones." So that's the --no-keep-cherry-pick option, which is the default.

> Add a flag to "git rebase" to allow suppression of this feature. This
> flag only works when using the "merge" backend.

Perhaps this is how I got confused. "suppression of this feature" probably got associated with the "--no-" version of the flag in my head. But that's not your fault. I'm probably biased from my experience with the --no-show-forced-updates flag in "git fetch". There, the "--no-" option disables the default behavior.

Maybe I wouldn't be as confused if the flag was reversed and called "--no-skip-cherry-picks" or something. That direction would make it more clear that this is a performance optimization with a possible behavior side-effect. I doubt users will be lining up to "keep cherry-picks." There is a reason we remove them by default, but it is also atypical for the check to actually change the outcome.

But if we have a config option to change the default (as a follow-up) then all of my complaints are reduced, because users will not need to think about this very often.

Show 10 quoted lines
> This flag changes the behavior of sequencer_make_script(), called from
> do_interactive_rebase() <- run_rebase_interactive() <-
> run_specific_rebase() <- cmd_rebase(). With this flag, limit_list()
> (indirectly called from sequencer_make_script() through
> prepare_revision_walk()) will no longer call cherry_pick_list(), and
> thus PATCHSAME is no longer set. Refraining from setting PATCHSAME both
> means that the intermediate commits in upstream are no longer read (as
> shown by the test) and means that no PATCHSAME-caused skipping of
> commits is done by sequencer_make_script(), either directly or through
> make_script_with_merges().

Perhaps the only change I would recommend for the commit message is to be very clear about what "this flag" means. You are talking about the "--keep-cherry-pick(s)" flag in this paragraph.

Thanks, -Stolee

Previous: Jonathan TanNext: Elijah Newren
Message 29 of 36 in “rebase --merge: optionally skip upstreamed commits”
  1. rebase --merge: optionally skip upstreamed commitsJonathan Tan, Mar 9, 2020
  2. Taylor BlauMar 10, 2020
  3. Jonathan TanMar 10, 2020
  4. Johannes SchindelinMar 10, 2020
  5. Jonathan TanMar 10, 2020
  6. Elijah NewrenMar 10, 2020
  7. Jonathan TanMar 10, 2020
  8. Jonathan TanMar 12, 2020
  9. Elijah NewrenMar 12, 2020
  10. Elijah NewrenMar 14, 2020
  11. Jonathan TanMar 17, 2020
  12. rebase --merge: optionally skip upstreamed commitsJonathan Tan, Mar 18, 2020
  13. Junio C HamanoMar 18, 2020
  14. Jonathan TanMar 18, 2020
  15. Junio C HamanoMar 18, 2020
  16. Elijah NewrenMar 18, 2020
  17. Junio C HamanoMar 18, 2020
  18. Elijah NewrenMar 19, 2020
  19. Junio C HamanoMar 18, 2020
  20. Jonathan TanMar 26, 2020
  21. Elijah NewrenMar 26, 2020
  22. Junio C HamanoMar 26, 2020
  23. rebase --merge: optionally skip upstreamed commitsJonathan Tan, Mar 30, 2020
  24. Junio C HamanoMar 30, 2020
  25. Danh DoanMar 30, 2020
  26. Derrick StoleeMar 30, 2020
  27. Junio C HamanoMar 30, 2020
  28. Jonathan TanMar 30, 2020
  29. Derrick StoleeMar 31, 2020
  30. Elijah NewrenMar 31, 2020
  31. Junio C HamanoMar 31, 2020
  32. Junio C HamanoMar 31, 2020
  33. Jonathan TanApr 10, 2020
  34. Elijah NewrenApr 11, 2020
  35. Jonathan TanApr 11, 2020
  36. Elijah NewrenApr 11, 2020

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.