git-import-srpm: add script to create source branches from srpm repository.#7
git-import-srpm: add script to create source branches from srpm repository.#7casasnovas wants to merge 1 commit intomainfrom
Conversation
|
This is a PR to merge in another non-main branch? |
This is to merge to main, but I didn't find a nicer way to stack PR on top of each other than chosing its parent branch. If this gets approved before the others, I'll just rebase that one commit on top of main before pushing. |
7af5a5f to
5c0cb13
Compare
Oh, ok! |
97f721a to
76d7132
Compare
I did the rebase now to make it less confusing. edit: for the other branches, that one actually depends on the prior two as it changes the README.md file, so I prefer to wait for the other two PRs to be merged to avoid having to deal with conflicts in the README.md. |
eeafee3 to
7b7b1ee
Compare
…itory.
On Debian derivatives, you'll need:
sudo apt-get install rpm
Simply run it inside a SRPM git repository and give it a revision (can be
tag, branch, sha1, ...), e.g.:
```bash
CODE_REPO_PATH=/path/to/linux/repo SRPM_REPO_PATH=/path/kernel/srpm/repo git-import-srpm XS-8.2.1
```
To import all releases as branches, just pass --all:
```bash
git-import-srpm --all
```
By default, the `SRPM_REPO_PATH` is the current working directory. If no
`CODE_REPO_PATH` is given, a default path is inferred that is
`${SRPM_REPO_PATH}/../(linux|xen|qemu)` (depending on the package being
imported).
The script was used import all branches of qemu, xen and the Linux kernel
released in current and prior XCP versions, e.g.:
- xen branch example: https://github.com/xcp-ng/xen/tree/xen/xcpng-4.17.5-23.1/base
- qemu branch example: https://github.com/xcp-ng/qemu-dp/tree/qemu/xcpng-4.2.1-5.2.15.2/base
- linux branch example: https://github.com/xcp-ng/linux/tree/linux/xcpng-4.19.19-8.0.32.1/base
The script gives idempotent runs, reconstructed git sha1 will stay the same
across runs for a given srpm revision. The script will not touch any of your
repository worktrees or indexes, so it is safe to run any time even if you are
working in the source repo (patches are applied separately in a temporary worktree).
Note that for each srpm revision, the script will create two branches in the source
repository, in the form:
<product>/(xcpng|xenserver)-<version>/(pre-base|base)
The pre-base ref will point to the upstream commit that was used as basis
by the source RPM before applying patches. Effectively, the patch-set
applied by a source rpm can be rev-listed with `git log /pre-base../base`
which allows see-ing how the patchset evolved over time.
You can use `git-review-rebase` easily on two imports to see the changes in
the patch-queues.
Original pull-request was on the
[xcp](xcp-ng/xcp#781) repository but after
discussion with the OS&Platform team, it was agreed it is better to have it
here. Sub-sequent work could try and add github workflows to run this
script automatically when we notice new SRPMs from XenServer, but right now
it is a manual process (so is running [import_srpm.py](https://github.com/xcp-ng/xcp/blob/master/scripts/import_srpm.py)).
Signed-off-by: Quentin Casasnovas <quentin.casasnovas@vates.tech>
76d7132 to
46cd37c
Compare
On Debian derivatives, you'll need:
sudo apt-get install rpm
Simply run it inside a SRPM git repository and give it a revision (can be tag, branch, sha1, ...), e.g.:
To import all releases as branches, just pass --all:
By default, the
SRPM_REPO_PATHis the current working directory. If noCODE_REPO_PATHis given, a default path is inferred that is${SRPM_REPO_PATH}/../(linux|xen|qemu)(depending on the package being imported).The script was used import all branches of qemu, xen and the Linux kernel released in current and prior XCP versions, e.g.:
The script gives idempotent runs, reconstructed git sha1 will stay the same across runs for a given srpm revision. The script will not touch any of your repository worktrees or indexes, so it is safe to run any time even if you are working in the source repo (patches are applied separately in a temporary worktree).
Note that for each srpm revision, the script will create two branches in the source repository, in the form:
/(xcpng|xenserver)-/(pre-base|base)
The pre-base ref will point to the upstream commit that was used as basis by the source RPM before applying patches. Effectively, the patch-set applied by a source rpm can be rev-listed with
git log /pre-base../basewhich allows see-ing how the patchset evolved over time.You can use
git-review-rebaseeasily on two imports to see the changes in the patch-queues.Original pull-request was on the
xcp repository but after discussion with the OS&Platform team, it was agreed it is better to have it here. Sub-sequent work could try and add github workflows to run this script automatically when we notice new SRPMs from XenServer, but right now it is a manual process (so is running import_srpm.py).