Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

example of using repo foreach to cherry-pick change #61

Merged
merged 1 commit into from
Dec 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions projects/rvi-repo-manifest/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,25 @@ After `repo init` is done once, `repo sync` can be used to clone the initial rep

NOTE: All `git` commands will continue to work in the individual projects as expected.

==== Cherry-pick edits across multiple repos (or how to use `repo foreach` to do work across multiple repos)

The goal of the example is to cherry-pick a commit from another repo and apply it to other repos using link:https://source.android.com/docs/setup/reference/repo#forall[`repo forall`]

NOTE: This example only shows doing it for one repo but the changes could be more broadly applied.

* create a dev branch:
** `repo start dev/kbroch/dependabot-update-docs-resources-submodule riscv/riscv-isa-manual`
* add remote that contains commit you want to cherry-pick:
** `repo forall riscv/riscv-isa-manual -v -c 'echo $REPO_PROJECT; git remote add docs-spec-template [email protected]:riscv/docs-spec-template.git'`
* fetch the remote above:
** `repo forall riscv/riscv-isa-manual -v -c 'echo $REPO_PROJECT; git fetch docs-spec-template'`
* cherry-pick the commit wanted:
** `repo forall riscv/riscv-isa-manual -v -c 'echo $REPO_PROJECT; git cherry-pick 5c19f62e25aeeda69886b07e7ec2959b1e632735'`
* push changes:
** `repo forall riscv/riscv-isa-manual -v -c 'echo $REPO_PROJECT; git push origin HEAD'`

NOTE: At this point, PRs need to be created individually.

=== Dev tasks

==== Generating a manifest file
Expand Down
Loading