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

keep master branch only #464

Open
toxa81 opened this issue Jan 22, 2020 · 7 comments
Open

keep master branch only #464

toxa81 opened this issue Jan 22, 2020 · 7 comments
Assignees

Comments

@toxa81
Copy link
Collaborator

toxa81 commented Jan 22, 2020

@simonpintarelli @mtaillefumier @AdhocMan

Guys! How about keeping master branch only. It will be updated only through pull requests. On your local git clone you will do

git checkout -b feature_xyz
git push -u upstream feature_xyz

and here you will open a pull-request from feature_xyz branch to master. The master branch will always be up-to-date with recent developments.

@mtaillefumier
Copy link
Collaborator

mtaillefumier commented Jan 23, 2020 via email

@AdhocMan
Copy link
Collaborator

I just came across desribing a model using a devlop branch:
https://nvie.com/posts/a-successful-git-branching-model/
This might be a good workflow to follow.

@toxa81
Copy link
Collaborator Author

toxa81 commented Feb 24, 2020

In that article everything is reasonable except for the marginal difference between develop and release branches. They are really identical because whatever you add to the release branch, you immediately want to merge into the current develop. Thus, I would like to propose a slightly simplified process:
git_process 001

Once we merge the develop into master, we bump the version of the code in develop and start working on the next release. When we merge, we use --no-ff flag as suggested in the article.

@haampie
Copy link
Collaborator

haampie commented Jun 23, 2020

Hadn't seen this issue before, so let me share a few thoughts.

I have never really understood the use for the develop branch in the successful-branching-model-article. If it's supposed to be a shared branch, things have to necessarily work already for it to make sense, so why can't it be in master? That simplifies releasing new versions and makes it clear where the latest code is and where to submit PRs to. For stable code people can just checkout a certain tag, right?

Also the successful branching model does not really deal with maintaining older minor versions of the software (hot fixes don't apply to 'master' only if you maintain multiple versions). I would agree with @mtaillefumier that it's useful to keep release branches around named release-<major>.<minor>, so that it's easy to create backports for bugfixes that have been merged into the master branch. In some projects people keep an open PR around that keeps track of all the commits in master that can be backported (e.g. JuliaLang/julia#35825), that can be done by cherry-picking the relevant commits from master. So, you would merge such a pr into the release-<major>-<minor> branch, and then afterwards tag v<major>.<minor>.<patch+1>.

In short: develop in master (so prs target master by default), when starting to release a new major version, create a release-<major>-<minor> branch, sometimes you cherry-pick some bugfix-commits on master (kinda like hot-fixes) and open a PR to one or more older release-<major>-<minor> branches, tags are created inside those release-<major>-<minor> branches.

@mtaillefumier
Copy link
Collaborator

The develop branch can be useful for instance when you refactor things that touch the core of the code but you do not have enough test coverage of the new code. I am facing this right now with CP2K which does not have a develop branch (they also have this clean linear history policy, no comments) so any pull request with "incomplete feature" will automatically affect everyone, something you do not necessarily want to do. For the rest, I am fine with any scheme that is reasonable.

@mtaillefumier
Copy link
Collaborator

To be also noted. The linux kernel does not have official devel branch but they have a separate linux-next repository that mimic the devel branch to some extend.

@haampie
Copy link
Collaborator

haampie commented Jun 23, 2020

Yeah, I see it can be useful, but I don't immediately see the difference with just keeping a pull request open for a bit longer instead of directly merging it into master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants