-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Blogpost-no-divergent-branches (#957)
Fixes #938
- Loading branch information
Showing
6 changed files
with
83 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
docs/fedora-releases-guide/non-divergent-dist-git-branches.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
--- | ||
title: Non-divergent dist-git branches | ||
sidebar_position: 7 | ||
--- | ||
|
||
# Non-divergent dist-git branches | ||
|
||
To prevent your dist-git branches from diverging, you can use the following `dist_git_branches` syntax: | ||
|
||
```yaml | ||
dist_git_branches: | ||
rawhide: | ||
fast_forward_merge_into: [fedora-branched] | ||
epel-9: {} | ||
``` | ||
In this example, Packit runs the downstream synchronization process for the `rawhide` and `epel-9` branches as usual. Additionally, Packit opens a new pull request reusing the commit from `rawhide` for every `fedora-branched` branch, allowing it to be fast-forwarded when merging. | ||
|
||
You can learn more about the `dist_git_branches` syntax for `propose_downstream` [here](docs/configuration/upstream/propose_downstream#optional-parameters) and for `pull_of_upstream` [here](docs/configuration/downstream/pull_from_upstream#optional-parameters). | ||
|
||
:::warning How to Reconcile Divergent Branches | ||
|
||
If you are already using Packit, your branches may have diverged. You need to reconcile them before using the new `dist_git_branches` syntax. For the configuration example above and the current state of the branched Fedora releases, you need to: | ||
|
||
``` | ||
git checkout rawhide | ||
git merge f39 | ||
git merge f40 | ||
git merge f41 | ||
``` | ||
|
||
You shouldn't encounter any conflicts. However, if you have a conflict in the `.gitignore` file, it is safe to keep changes from both `rawhide` and the incoming branch. If you have a conflict in the changelog section of the specfile, ensure you **merge all the missing changelogs** into `rawhide` and list them **in the correct order** (newest changelogs first). Once `rawhide` is ready, you can proceed with: | ||
|
||
``` | ||
# [TODO] Adjust the releases, if needed. | ||
git checkout f39; git merge --ff-only rawhide | ||
git checkout f40; git merge --ff-only rawhide | ||
git checkout f41; git merge --ff-only rawhide | ||
``` | ||
|
||
::: | ||
|
||
:::warning Fast Forwarding multiple commits does not automatically trigger a Koji build (Yet) | ||
|
||
Unfortunately, there is a [bug](https://github.com/packit/packit-service/issues/2537) that prevents Packit from triggering the **Koji build** when more than one commit has been forwarded in a branch. | ||
|
||
You can work around this bug by manually retriggering the Koji build by commenting on the downstream merged pull request with `/packit koji-build`. | ||
|
||
::: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
title: "No more divergent dist-git branches with Packit!" | ||
date: 2024-10-28T10:46:18+00:00 | ||
authors: mmassari | ||
tags: | ||
- propose-downstream | ||
- pull-from-upstream | ||
- downstream | ||
- configuration | ||
--- | ||
|
||
Were you annoyed by Packit creating divergent branches in your package's dist-git repository? You'll be happy to know that Packit now supports a new `dist_git_branches` syntax that enables fast-forwarding commits between branches. | ||
|
||
<!--truncate--> | ||
|
||
## What's New | ||
|
||
When defining a `propose-downstream` or `pull-from-upstream` job, you can use the new `dist_git_branches` syntax. | ||
|
||
``` | ||
dist_git_branches: | ||
rawhide: | ||
fast_forward_merge_into: [fedora-branched] | ||
epel-9: {} | ||
``` | ||
|
||
In this example, Packit runs the downstream synchronization process for the `rawhide` and `epel-9` branches as usual. Additionally, Packit opens a new pull request, reusing the commit from `rawhide`, for every `fedora-branched` branch, allowing it to be fast-forwarded when merging. | ||
|
||
Do you want to know more? Look at the [non-divergent dist-git branches guide](/docs/fedora-releases-guide/non-divergent-dist-git-branches) |