Hi All,
I'm new to repo and I'm currently having a hard time understanding how the manifest branches are supposed to be handled.
Here is my situation : I work in a software company where we have a master branch, then a limited number of supported release branches forked off the master branch. I'm trying to see which architecture/workflow could suit our need using repo+git. (We're transitioning from CVS)
So far I've kind of hit a wall trying to see how developers could switch back and forth between the development branch (master) and the various maintenance branches for already released products.
My current setup is the following. In the manifest repository master I've set the default tracking branch to master :
<default revision="master"
remote="myremote"
sync-j="4" />
Then I've created a manifest-branch for a maintenance branch, let's call in maintenance-1.0. The manifest stays the same only for the default revision which is in this case : default revision="prod_branch_v1.0"
No let's try this out, I'm a developer I start by checking out the repository :
* repo init -u ~/public/manifest.git
* repo sync
* repo start --all master
[Do some work ...]
Until this point everything works fine.
Now, at some point let's say that the local repository is in sync with the central repository and the topic branch master is checked out.
The developer needs to switch to a production branch, for instance in order to port some hotfixes there.
I would expect the following sequence to allow this seamlessly
* repo init -b maintenance-1.0
* repo sync
* repo start --all prod_branch_v1.0
However trying to use this workflow I'm running into some troubles :
* First of all, it looks like repo will try rebasing the contents of the master-manifest onto the production-manifest. For instance, if the two have diverged repo will drop me at the beginning of the procedure complaining that the rebase failed.
Looking into this I stumbled upon the following post :
https://groups.google.com/forum/?fromgroups#!searchin/repo-discuss/manifest$20branch/repo-discuss/VIJEv1kSuNU/L_s7iXKZJoMJWhich seem to suggest that this a bug in repo, however this post has not been updated since 2009, is this still valid ?
* If the two manifests did not diverge, the init -b works just fine.
However the sync is giving the same troubles : instead of seeing that the manifest branch has changed and switching to the new default revision, repo is trying to rebase again :
Deleting obsolete path ~/repotest/docs
Deleting obsolete path ~/repotest/thirdparty
Deleting obsolete path ~/repotest/wrappers
code/: manifest switched master...prod_branch_v1.0
code/: discarding 314 commits removed from upstream
project code_2/
First, rewinding head to replay your work on top of it...
[..]
Rebase fails ..
If instead of this I start from a "detached" repo (ie I don't create the initial master topic using repo start --all master) then this sync step looks better. However I still get
code/: discarding 314 commits
messages, which I don't really know what to think about.
Anyway from that point the repositories seem to be in a good state with the correct revision being checked out and branch tracking correctly set up :
* (no branch)
remotes/m/master -> myremote/master
remotes/m/maintenance-1.0 -> myremote/prod_branch_v1.0
remotes/myremote/master
remotes/myremote/prod_branch_v1.0
But starting there however, if I try to go back to master :
repo init -b master
repo sync
Then "nothing happens" and the tree stays checked out on maintenance-1.0.
Again this is because repo rebased the maintenance-1.0 manifest branch onto master, which result into the final manifest being the production one instead of the expected one.
Also note that
* repo init -u ~/public/manifest.git
* repo sync
* repo start --all master
* repo sync -d
* repo init -b maintenance-1.0
* repo sync
Does not work either. I would expect repo sync -d to detach all
repositories from master, but in practice it doesn't, issuing a repo
status after repo sync -d shows that all repositories are still attached
to master.
Now I think I must be getting it wrong. Seeing that any action I try out ends up with an unwanted rebase It looks like I'm misunderstanding the role of manifest branches : I don''t see how they could be used in practice if switching from one to the other always triggers rebases.
I've looked at how this is used in android, and it seems that the use case is pretty much the same and should suffer the same shortcomings (ie: first init on a specific manifest branch will work, but switching branches is not something you should do ...)
So to sum it up, I've got a few questions here :
* Is switching *manifest* branches in an already checked out repo supported at all ? Does this mean the only way to achieve what I want is for every developer to keep as many separate "checkouts" as we have production branches (+ master) ?
* Do you have any suggestion regarding how we could get this ability to switch between branches that are not in sync / not meant to be re-based on each others ? Because it looks there is currently no way to prevent a "sync" from re-basing everything
* More generally what would currently the right workflow to handle production branches using repo ?
* Which of the test case described above are "expected" and which are bugs ? For instance shouldn't repo sync -d return to a detached head state even if the tree is already on the right revision ?
Thank you in advance for your time,
Regards,
Florian