Rebase chain - new experimental feature

591 views
Skip to first unread message

Milutin Kristofic

unread,
Jan 26, 2023, 7:04:10 AM1/26/23
to repo-d...@googlegroups.com
Hi Gerrit Users,

We are testing the new Rebase Chain feature on the gerrit host (and in canary hosts as well).
6Lyxbrpit6WfEm8.png


Reach out to us!

- Milutin on behalf of the Gerrit Code Review team

Sven Selberg

unread,
Jan 26, 2023, 7:47:35 AM1/26/23
to Repo and Gerrit Discussion
On Thursday, January 26, 2023 at 1:04:10 PM UTC+1 mil...@google.com wrote:
Hi Gerrit Users,

We are testing the new Rebase Chain feature on the gerrit host (and in canary hosts as well).
6Lyxbrpit6WfEm8.png

Awesome!
We have this feature as a plugin @ $DAYJOB and it is very useful when working with stacks of changes.
(IIRC it haven't been open-sourced because it had some hacky solution for something that I don't think would have been accepted...).

Luca Milanesio

unread,
Jan 26, 2023, 4:35:56 PM1/26/23
to Repo and Gerrit Discussion, Luca Milanesio

On 26 Jan 2023, at 12:47, Sven Selberg <sven.s...@axis.com> wrote:



On Thursday, January 26, 2023 at 1:04:10 PM UTC+1 mil...@google.com wrote:
Hi Gerrit Users,

We are testing the new Rebase Chain feature on the gerrit host (and in canary hosts as well).
6Lyxbrpit6WfEm8.png

Awesome!

I’ll offer *one drink* for every click I save with this fantastic feature!!! Well done!

Luca.

We have this feature as a plugin @ $DAYJOB and it is very useful when working with stacks of changes.
(IIRC it haven't been open-sourced because it had some hacky solution for something that I don't think would have been accepted...).



Reach out to us!

- Milutin on behalf of the Gerrit Code Review team


--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/dc4d9201-34a2-4d37-94df-b98f35e977can%40googlegroups.com.
6Lyxbrpit6WfEm8.png

Sven Selberg

unread,
Jan 27, 2023, 10:00:00 AM1/27/23
to Repo and Gerrit Discussion
On Thursday, January 26, 2023 at 1:47:35 PM UTC+1 Sven Selberg wrote:
On Thursday, January 26, 2023 at 1:04:10 PM UTC+1 mil...@google.com wrote:
Hi Gerrit Users,

We are testing the new Rebase Chain feature on the gerrit host (and in canary hosts as well).

Is there an API for checking whether the chain is up-to-date?

Nitzan Gur-Furman

unread,
Jan 31, 2023, 2:03:34 AM1/31/23
to Sven Selberg, Repo and Gerrit Discussion
Hi,
Sorry for chiming in late.
Is there an API for checking whether the chain is up-to-date?
  1.  If the chain itself was updated-
    In the UI:
    The ancestors will appear as "Not current".
    image.png
    Descendants of older versions of the current change appear as "Indirect relation". Note this will also appear if the descendants were rebased on another change.
    image.png
    `related` is the API powering the "Relation chain" section.
  2. If the target branch contains (new) conflicting changes, the status of the change appears as "Merge Conflict".
    image.png
    You can use the `mergable` API to determine that.
For the record, `rebase:chain` is powering the new "Rebase all ancestors" option.

LMK if you have any further questions,
~Nitzan


--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.

Sven Selberg

unread,
Jan 31, 2023, 3:04:46 AM1/31/23
to Repo and Gerrit Discussion
On Tuesday, January 31, 2023 at 8:03:34 AM UTC+1 Nitzan Gur-Furman wrote:
Hi,
Sorry for chiming in late.

Thanks for the reply Nitzan.
 
Is there an API for checking whether the chain is up-to-date?
  1.  If the chain itself was updated-
    In the UI:
    The ancestors will appear as "Not current".
    image.png
    Descendants of older versions of the current change appear as "Indirect relation". Note this will also appear if the descendants were rebased on another change.
    image.png
    `related` is the API powering the "Relation chain" section.
AFAICT the `related` API only gives you a list of changes that are related to the current change it says nothing about if the current patchset of the change is a direct ancestor of the target branch.
So I assume the UI does it's own revision-walk to figure out which changes are up-to-date and which ones aren't, using this API would enforce all services to learn git.

I was asking if there's an API where you could ask of this state in a single GET like:

    GET /changes/$CHANGE_IDENTIFIER?o=ANCESTRY

    {
      ...
      "needs_rebase" : True
      ...
    }
  1. If the target branch contains (new) conflicting changes, the status of the change appears as "Merge Conflict".
    image.png
    You can use the `mergable` API to determine that.
And we do to check for merge conflicts, but if the change is mergeable it doesn't necessarily say much about the up-to-dateness of the change.
It might be a good place to add ancestry status though since it indicates clearly what would be the result of a merge
  { 
    submit_type: "MERGE_IF_NECESSARY",
    strategy: "recursive",
    mergeable: true,
    up_to_date: false // or `direct_ancestry`
 } 

For the record, `rebase:chain` is powering the new "Rebase all ancestors" option.

For the record `rebase:chain` only have a PUT, not a GET for the current state ("what a PUT would do") AFAICT.
Reply all
Reply to author
Forward
0 new messages