Skip to content

[2/4] Introduce the git-review-rebase tool as well as documentation on rebasing to latest upstream.#3

Merged
casasnovas merged 5 commits intomainfrom
quentin-rebase-upstream
Mar 12, 2026
Merged

[2/4] Introduce the git-review-rebase tool as well as documentation on rebasing to latest upstream.#3
casasnovas merged 5 commits intomainfrom
quentin-rebase-upstream

Conversation

@casasnovas
Copy link
Copy Markdown
Collaborator

@casasnovas casasnovas commented Mar 2, 2026

The git-review-rebase tool is to help reviewing rebases to upstream branches. It is part of an effort
to be able to emancipate from XenServer when it comes to dom0 kernel maintainance.

For context, this docmost page was created for the rationale behind diverging from XenServer:

https://notes.vates.tech/s/vatesglobal/p/proposal-emancipation-from-xs-linux-kernel-for-xcp-ng-8-3-and-apply-WDv7wHUn8z

This pull-request is the second in a series adding tools and documentation on maintaining
our dom0 kernel - for extra context, the final state can be seen here (the final README
especially):

https://github.com/xcp-ng/hypervisor-dev/tree/quentin-main

I've tried to split the changes into palatable/reviewable PRs, full list:

@casasnovas
Copy link
Copy Markdown
Collaborator Author

casasnovas commented Mar 3, 2026

To test the tool, you can use two XenServer branches from https://github.com/xcp-ng/xen:

cd /path/to/xen/repo
git-review-rebase --repository . \
  xen/xenserver-4.13.5-10.51/pre-base..xen/xenserver-4.13.5-10.51/base \
  xen/xenserver-4.13.5-10.58/pre-base..xen/xenserver-4.13.5-10.58/base

Or use the big rebased dom0 kernel branches:

cd /path/to/linux/repo
git-review-rebase --repository . \
  vates/kernel/xcpng-4.19.19-8.0.44.1/pre-base..vates/kernel/xcpng-4.19.19-8.0.44.1/base \
  vates/kernel/xcpng-4.19.325-cip129.8.0.44.1/pre-base..vates/kernel/xcpng-4.19.325-cip129.8.0.44.1/base

Note

On the linux kernel it will take a very long time to load the first time unless you populate a cache of patch-ids - you can do so by stuffing the patch-ids-packed-refs.txt in your linux repo:

cd /path/to/linux/repo
cat /path/to/patch-ids-packed-refs.txt >> .git/packed-refs

This is because there are 31K commits between v4.19.19 and v4.19.325-cip129

@casasnovas casasnovas force-pushed the quentin-rebase-upstream branch from f8619ee to 693c028 Compare March 12, 2026 07:40
@casasnovas casasnovas force-pushed the quentin-locked-list branch from cc0643b to 19dfc67 Compare March 12, 2026 07:40
@casasnovas casasnovas force-pushed the quentin-rebase-upstream branch from 693c028 to deab814 Compare March 12, 2026 08:31
@casasnovas casasnovas requested a review from fallen March 12, 2026 08:31
@casasnovas casasnovas force-pushed the quentin-rebase-upstream branch 2 times, most recently from f81b35a to 28a2185 Compare March 12, 2026 08:42
Copy link
Copy Markdown

@fallen fallen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, nice tool!

This script is here to help review rebases by presenting the symmetric
difference of rebased commits in two ranges. Rebased commits are matched by
multiple heuristics (in priority order: commit sha1, patch-ids, title) and
it is possible to see a side-by-side diff of matched commits by pressing
enter. The list of commits can be filtered by match-type, or fuzzy-filtered
based on commit sha1s or titles.

The side-by-side diff can be augmented with either full function context,
or git blame info by pressing specific keys.

Comments on dropped commits can be added, so that the person doing the
rebase can justify dropped commits.

Patch-ids are cached directly within the git repo, in specific refs, so
that patch-ids caches can be shared amongst developers and don't have to be
recomputed too often as it is a slow operation.

Signed-off-by: Quentin Casasnovas <quentin.casasnovas@vates.tech>
Signed-off-by: Quentin Casasnovas <quentin.casasnovas@vates.tech>
We can't always use the old_file path to infer a lexer, because the file
might be created within the commit.  In that case, fallback on the
new_file.

While at it, use a default TextLexer when pygments doesn't have a good
parser for the file it is looking at, this avoids a crash as well.

Signed-off-by: Quentin Casasnovas <quentin.casasnovas@vates.tech>
This chapter details the steps required to rebase our kernel onto a new
upstream version.

Signed-off-by: Quentin Casasnovas <quentin.casasnovas@vates.tech>
These were taken from:

  https://github.com/xcp-ng/python-project-template/

And adapter to run for a python project in a sub-directory.

Signed-off-by: Quentin Casasnovas <quentin.casasnovas@vates.tech>
@casasnovas casasnovas force-pushed the quentin-rebase-upstream branch from 28a2185 to b3647e2 Compare March 12, 2026 14:53
@casasnovas casasnovas closed this Mar 12, 2026
@casasnovas casasnovas reopened this Mar 12, 2026
@casasnovas casasnovas changed the base branch from quentin-locked-list to main March 12, 2026 15:15
@casasnovas casasnovas merged commit b3647e2 into main Mar 12, 2026
10 checks passed
@casasnovas casasnovas deleted the quentin-rebase-upstream branch March 16, 2026 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants