Main/Trunk and what's else?

Programming, for all ages and all languages.
Post Reply
PeterX
Member
Member
Posts: 590
Joined: Fri Nov 22, 2019 5:46 am

Main/Trunk and what's else?

Post by PeterX »

I've read the Osdev.org wiki about Code managment and the wikipedia article about version control. And this page:

https://betterexplained.com/articles/a- ... n-control/

This page mentions Trunk/Main. And it says that the main code goes in there. But what goes into the OTHER areas? Non-code? Tools? Usage examples? How can a developer pretend there were unimportant code parts? They are all important! I don't understand it. I already searched the forum for trunk.
nullplan
Member
Member
Posts: 1766
Joined: Wed Aug 30, 2017 8:24 am

Re: Main/Trunk and what's else?

Post by nullplan »

The current state of development goes into the trunk/master branch. That one is supposed to be relatively stable. When you start development on a new feature, or you chase a bug, you create a branch from there, develop the feature on the branch, then merge the branch back. This allows you to have multiple outstanding changes at the same time. In professional development, usually the person merging the branch is not the person developing it, and they do a code review along with the merge. Also, typically multiple branches are outstanding at the same time, with multiple people working on each.

For hobby OSDev, you may find it useful to create branches to focus your efforts. Especially when starting out, there is so much to do it can be hard to focus. But then, while chasing issue A, you don't want to get bogged down with issue B along the way. Also, since the master is supposed to be relatively stable, you always have a version available that at least boots and runs.

Once time comes to create a release, you can create a tag from the master branch. You can also tag branch revisions, but I find that to be weird.
Carpe diem!
Post Reply