Merge Guidelines: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
(With the new branch policy in place, there is no merge process for Qt in general.)
(→‎Merge instructions: Replace CODE-tagged blocks with SYNTAXHIGHLIGHT, wrap CODE around more literals in body text)
 
Line 9: Line 9:


There are several ways to go about the merges, for individual merges of one repository use the normal git merge command.
There are several ways to go about the merges, for individual merges of one repository use the normal git merge command.
<code lang="bash">
<syntaxhighlight lang="sh">
git fetch
git fetch
git checkout -B dev origin/dev
git checkout -B dev origin/dev
git merge origin/stable
git merge origin/stable
git push gerrit HEAD:refs/for/dev
git push gerrit HEAD:refs/for/dev
</code>
</syntaxhighlight>
Note that you need special permissions to push merges and gerrit will refuse your push otherwise.
Note that you need special permissions to push merges and gerrit will refuse your push otherwise.


Since it's not feasible to do so many commands manually for each repository, there is a script in qtrepotools/bin.
Since it's not feasible to do so many commands manually for each repository, there is a script in <code>qtrepotools/bin</code>.
Make sure to have python and qtrepotools/bin in your path.
Make sure to have <code>python</code> and <code>qtrepotools/bin</code> in your path.
<code lang="bash">
<syntaxhighlight lang="sh">
cd qt5 # this command needs a full checkout of qt5.git and all submodules
cd qt5 # this command needs a full checkout of qt5.git and all submodules
git qt-merge-mainlines -s -f stable -t dev
git qt-merge-mainlines -s -f stable -t dev
</code>
</syntaxhighlight>
Shows the status. Pass it -d to do the merges. -f is the source branch and -t is the branch that the merge ends up in.
The <code>-s</code> flag shows the status. Pass it <code>-d</code> to do the merges. <code>-f</code> sets the source branch ('''f'''rom) and <code>-t</code> sets the branch that the merge ends up in ('''t'''o).

Latest revision as of 06:41, 6 February 2023

Merge process in Qt

After 15/05/2020, merges are no longer performed for most modules and branches. Instead, all changes go into dev, and are cherry-picked down into more stable branches.

However, the maintainers of a module might decide to continue development on a stable branch. For example, the module might not be part of the Qt 6.0 scope, so it will be maintained in the 5.15 branch. To enable a port to Qt 6 later, regular merges into dev might then be an option.

Merge instructions

There are several ways to go about the merges, for individual merges of one repository use the normal git merge command.

git fetch
git checkout -B dev origin/dev
git merge origin/stable
git push gerrit HEAD:refs/for/dev

Note that you need special permissions to push merges and gerrit will refuse your push otherwise.

Since it's not feasible to do so many commands manually for each repository, there is a script in

qtrepotools/bin

. Make sure to have

python

and

qtrepotools/bin

in your path.

cd qt5 # this command needs a full checkout of qt5.git and all submodules
git qt-merge-mainlines -s -f stable -t dev

The

-s

flag shows the status. Pass it

-d

to do the merges.

-f

sets the source branch (from) and

-t

sets the branch that the merge ends up in (to).