Git flow

Genode's official Git repository is hosted at Codeberg.org:

Project at Codeberg.org

https://codeberg.org/genodelabs/genode

Main and staging

The official Git repository has two branches "main" and "staging".

Main branch

The main branch is the recommended branch for users of the framework. It is known to have passed quality tests. The existing history of this branch is fixed and will never change.

Staging branch

The staging branch contains the commits that are scheduled for inclusion into the main branch. However, before changes are merged into the main branch, they are subjected to quality-assurance measures conducted by Genode Labs. Those measures include the successful building of the framework for all base platforms and the passing of automated tests. After changes enter the staging branch, those quality-assurance measures are expected to fail. If so, the changes are successively refined by a series of fixup commits. Each fixup commit should refer to the commit it is refining using a commit message as follows:

 fixup "<commit message of the refined commit>"

If the fixup is non-trivial, change the "fixup" prefix to "squash" and add a more elaborative description to the commit message.

Once the staging branch passes the quality-assurance measures, the Genode maintainers tidy-up the history of the staging branch by merging all fixup commits with their respective original commit. The resulting commits are then merged on top of the main branch and the staging branch is reset to the new main branch.

Note that the staging branch is volatile. In contrast to the main branch, its history is not stable. Hence, it should not be used to base developments on.

Release version

The version number of a Genode release refers to the release date. The two-digit major number corresponds to the last two digits of the year and the two-digit minor number corresponds to the month. For example, "26.05".

Each Genode release represents a snapshot of the main branch taken at release time. It is complemented by the following commits:

The latter commit is tagged with the version number. The tag is signed by one of the mainline developers.

Development practice

Each developer maintains a fork of Genode's Git repository. To facilitate close collaboration with the developer community, it is recommended to host the fork on Codeberg.org. Create a Codeberg account, use Codeberg's web interface to create a new fork, and follow the steps given by Codeberg to fetch the cloned repository to your development machine.

In the following, we refer to the official Genode repository as "genodelabs/genode". To conveniently follow the project's mainline development, it is recommended to register the official repository as a "remote" in your Git repository:

 git remote add genodelabs https://codeberg.org/genodelabs/genode.git

Once, the official repository is known to your clone, you can fetch new official revisions via

 git fetch genodelabs

Topic branches

As a rule of thumb, every line of development has a corresponding topic in the issue tracker. This is the place where the developers discuss and review the ongoing work. Hence, when starting a new line of development, the first step should be the creation of a new topic.

Issue tracker

https://codeberg.org/genodelabs/genode/issues

The new topic should be accompanied with a short description about the motivation behind the line of work and the taken approach. The second step is the creation of a dedicated topic branch in the developer's fork of Genode's Git repository.

 git checkout -b issue<number> genodelabs/main

The new topic branch should be based on the most current genodelabs/main branch. This eases the later integration of the topic branch into the mainline development.

While working on a topic branch, it is recommended to commit many small intermediate steps. This is useful to keep track of the line of thoughts during development. This history is regarded as volatile. That is, it is not set in stone. Hence, you as developer do not have to spend too much thoughts on the commits during the actual development.

Once the work on the topic is completed and the topic branch is going to get integrated into the mainline development, the developer curates the topic-branch history so that a short and well-arranged sequence of commits remains. This step is usually performed by interactively editing the topic-branch history via the git rebase -i command. In many cases, the entire topic branch can be squashed into a single commit. The goal behind this curating step is to let the mainline history document the progress at a level of detail that is meaningful for the users of the framework. The mainline history should satisfy the following:

Coding conventions

Genode's source code follows time-tested conventions regarding the coding style and code pattern, which are important to follow. The coding style is described in the following document:

Coding-style Guidelines

https://genode.org/documentation/developer-resources/coding_style

Writing a commit message

Commit messages should adhere the following convention. The first line summarizes the commit using no more than 50 characters. This line will be displayed by various tools. So it should express the basic topic. For example:

 tool: add sanity checks in tool/tool_chain

After a blank line, a description of the patch follows. The description should consider the following questions:

If the patch refers to an existing issue, add a reference to the corresponding issue by stating "Issue genodelabs/genode#N" in the commit message where N is the issue number. This will make the commit visible in the stream of discussion of the corresponding issue. Should the patch be unrelated to any existing issue, consider opening a new issue first. Whenever the patch is supposed to close an existing issue, add this information by stating "Fixes genodelabs/genode#N" in your commit message. This will close the issue automatically as soon as the commit enters the main branch.

Reconsider the documentation related to your patch: If the commit message contains important information not present in the source code, this information should better be placed into the code or the accompanied documentation (e.g., in the form of a README file).