Branch discussions
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
14 posts
• Page 1 of 1
Branch discussions
by Chris H. » 09 Mar 2012, 13:56
Several people have mentioned that we might want to consider creating branches in our Forge project at the SVN. Our discussions so far have taken place on various topics and I felt that it might make sense to create a topic devoted to this issue.
I myself and other people have little experience in this area. It might be fairly easy to create a branch and to then merge the changes made to the new branch into the main trunk at some point. I can not volunteer to be the team leader and to then guide everyone's efforts in this area.
We recently had a branch with just the cardsfolder for use with adding in the new DKA cards before release. This worked and did not create any problems with my being able to release daily snapshot builds. A couple of links for anyone interested:
http://www.slightlymagic.net/forum/viewtopic.php?f=52&t=5804&start=15#p78965
http://www.slightlymagic.net/forum/viewtopic.php?f=52&t=5804&start=15#p78989
I myself and other people have little experience in this area. It might be fairly easy to create a branch and to then merge the changes made to the new branch into the main trunk at some point. I can not volunteer to be the team leader and to then guide everyone's efforts in this area.

We recently had a branch with just the cardsfolder for use with adding in the new DKA cards before release. This worked and did not create any problems with my being able to release daily snapshot builds. A couple of links for anyone interested:
http://www.slightlymagic.net/forum/viewtopic.php?f=52&t=5804&start=15#p78965
http://www.slightlymagic.net/forum/viewtopic.php?f=52&t=5804&start=15#p78989
-
Chris H. - Forge Moderator
- Posts: 6320
- Joined: 04 Nov 2008, 12:11
- Location: Mac OS X Yosemite
- Has thanked: 644 times
- Been thanked: 643 times
Re: Branch discussions
by friarsol » 09 Mar 2012, 16:04
This is definitely something we should try to start doing sometime soon.
We can do things like this:
1. As we approach a release with all the expected features, we spawn a branch for that release.
2. No new features are added into this branch, only bugfixes. Normal development continues on the main branch. Bugfixes would be merged into the release branch (and the trunk if appropriate).
3. During this "release time", release candidates are released in some regular fashion (maybe not daily, mostly dependent on how many bugfixes are coming in). These would be the same theoretically as a nightly build.
4. Once the Beta is released, the branch should be locked from future check-ins.
We can do things like this:
1. As we approach a release with all the expected features, we spawn a branch for that release.
2. No new features are added into this branch, only bugfixes. Normal development continues on the main branch. Bugfixes would be merged into the release branch (and the trunk if appropriate).
3. During this "release time", release candidates are released in some regular fashion (maybe not daily, mostly dependent on how many bugfixes are coming in). These would be the same theoretically as a nightly build.
4. Once the Beta is released, the branch should be locked from future check-ins.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Branch discussions
by Hellfish » 09 Mar 2012, 18:40
I was gonna ask about branching for the Archetype recognition work (It's coming, I swear! >_< ). The thing is, this branch (as with the release branches) will cover the entire project, essentially doubling the disk space required,right? Won't this escalate quickly?Might want to talk to our gracious host about that, if so.
Correct me if I'm wrong, I'm not familiar with SVN's inner workings.
Also, a step-by-step on branching with subclipse on the wiki would be good.
Correct me if I'm wrong, I'm not familiar with SVN's inner workings.
Also, a step-by-step on branching with subclipse on the wiki would be good.
So now you're
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
-
Hellfish - Programmer
- Posts: 1297
- Joined: 07 Jun 2009, 10:41
- Location: South of the Pumphouse
- Has thanked: 110 times
- Been thanked: 169 times
Re: Branch discussions
by friarsol » 09 Mar 2012, 19:09
In short, no.Hellfish wrote:I was gonna ask about branching for the Archetype recognition work (It's coming, I swear! >_< ). The thing is, this branch (as with the release branches) will cover the entire project, essentially doubling the disk space required,right? Won't this escalate quickly?Might want to talk to our gracious host about that, if so.
Correct me if I'm wrong, I'm not familiar with SVN's inner workings.
From http://svnbook.red-bean.com/en/1.0/ch04s02.html
- SVN Structure | Open
- Cheap Copies
Subversion's repository has a special design. When you copy a directory, you don't need to worry about the repository growing huge—Subversion doesn't actually duplicate any data. Instead, it creates a new directory entry that points to an existing tree. If you're a Unix user, this is the same concept as a hard-link. From there, the copy is said to be “lazy”. That is, if you commit a change to one file within the copied directory, then only that file changes—the rest of the files continue to exist as links to the original files in the original directory.
This is why you'll often hear Subversion users talk about “cheap copies”. It doesn't matter how large the directory is—it takes a very tiny, constant amount of time to make a copy of it. In fact, this feature is the basis of how commits work in Subversion: each revision is a “cheap copy” of the previous revision, with a few items lazily changed within. (To read more about this, visit Subversion's website and read about the “bubble up” method in Subversion's design documents.)
Of course, these internal mechanics of copying and sharing data are hidden from the user, who simply sees copies of trees. The main point here is that copies are cheap, both in time and space. Make branches as often as you want.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Branch discussions
by Chris H. » 26 Apr 2012, 13:45
Copied from message:
Re: Forge version 1.2.7
Re: Forge version 1.2.7
ArsenalNut wrote:friarsol wrote:Sloth wrote:Are we still aiming for a release on the 28th (AVR Pre-release day)?
Then we should consider making Snapshot builds with AVR cards to have some more testers before the beta (merging the branch).
Maybe we can have a Snapshot build available on the 28th for anyone who wants to play with AVR that day. And when release shortly after mtgdata is ready for Oracle text. This way we can merge the AVR cards some point this week (maybe Wed) and give the svn folk sometime before that first Snapshot happens.
I wish I had seen this before Sloth did the merge. There is really no reason to merge the cards until the complete data is ready. You can make a snap shot build by switching the cardsfolder the appropriate branch before the build is kicked off. As for the SVN folk, they already have access to the cards if the know how to switch branches.
Typically for a "feature" branch like the AVR cards, you only want to merge it into the trunk once. After the merge, no further work should be done in that branch and the branch could even be deleted. Otherwise you end up in a situation like we have now where cards got checked into the branch after the merge.
Also the feature branch should be updated with changes from the trunk before a merge. This gets any updates to older cards so you don't get conflicts when you merge the branch. You would also want to do the update from the trunk right before a snap shot build with the feature branch.
-
Chris H. - Forge Moderator
- Posts: 6320
- Joined: 04 Nov 2008, 12:11
- Location: Mac OS X Yosemite
- Has thanked: 644 times
- Been thanked: 643 times
Re: Branch discussions
by friarsol » 26 Apr 2012, 14:56
We should definitely build a more strict timeline of when everything is occurring now that we're using Branches for new sets. I didn't have an issue with merging the branch on Wednesday as magiccards.info usually updates on Thursday allowing for any Set related code additions to go in, and then the SetInfoScript to be run once it could grab the right data.ArsenalNut wrote:I wish I had seen this before Sloth did the merge. There is really no reason to merge the cards until the complete data is ready. You can make a snap shot build by switching the cardsfolder the appropriate branch before the build is kicked off. As for the SVN folk, they already have access to the cards if the know how to switch branches.
Typically for a "feature" branch like the AVR cards, you only want to merge it into the trunk once. After the merge, no further work should be done in that branch and the branch could even be deleted. Otherwise you end up in a situation like we have now where cards got checked into the branch after the merge.
Also the feature branch should be updated with changes from the trunk before a merge. This gets any updates to older cards so you don't get conflicts when you merge the branch. You would also want to do the update from the trunk right before a snap shot build with the feature branch.
I definitely wasn't expecting a Snapshot build to happen until all of that was performed (and really I wasn't expecting it until Saturday or maybe late Friday). It would probably simplify things long-term to not merge until we can do all of the above things, as we could just handle it all in a row instead of having to step gingerly for a few days near Set Releases.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Branch discussions
by ArsenalNut » 26 Apr 2012, 16:06
I definitely agree about having a more strict timeline. I would suggest waiting till both magiccards.info is updated and the picture URLs are valid before merging back into the main trunk. I think this would help minimize potential problems. I haven't tested to see what happens when you try to download card images when the URL is not valid. I have also had the deck editor crash on me a couple time when working on the AVR cards. It looked like it was having issues with sorts when there wasn't valid set info. I'll try to reproduce the crash and post to the bug report message.friarsol wrote:We should definitely build a more strict timeline of when everything is occurring now that we're using Branches for new sets. I didn't have an issue with merging the branch on Wednesday as magiccards.info usually updates on Thursday allowing for any Set related code additions to go in, and then the SetInfoScript to be run once it could grab the right data.
I definitely wasn't expecting a Snapshot build to happen until all of that was performed (and really I wasn't expecting it until Saturday or maybe late Friday). It would probably simplify things long-term to not merge until we can do all of the above things, as we could just handle it all in a row instead of having to step gingerly for a few days near Set Releases.
So many cards, so little time
-
ArsenalNut - Posts: 512
- Joined: 08 Jul 2011, 03:49
- Has thanked: 27 times
- Been thanked: 121 times
Re: Branch discussions
by ArsenalNut » 11 May 2012, 12:49
Here's a quote from Apache's Subversion Best Practices webpage from the Know when to create branches section
I think this would the best branching model for the Forge project to adopt.SVN.Apache wrote:The Branch-When-Needed system
(This is the system used by the Subversion project.)
Users commit their day-to-day work on /trunk.
Rule #1: /trunk must compile and pass regression tests at all times. Committers who violate this rule are publically humiliated.
Rule #2: a single commit (changeset) must not be so large so as to discourage peer-review.
Rule #3: if rules #1 and #2 come into conflict (i.e. it's impossible to make a series of small commits without disrupting the trunk), then the user should create a branch and commit a series of smaller changesets there. This allows peer-review without disrupting the stability of /trunk.
Pros: /trunk is guaranteed to be stable at all times. The hassle of branching/merging is somewhat rare.
Cons: Adds a bit of burden to users' daily work: they must compile and test before every commit.
So many cards, so little time
-
ArsenalNut - Posts: 512
- Joined: 08 Jul 2011, 03:49
- Has thanked: 27 times
- Been thanked: 121 times
Re: Branch discussions
by Chris H. » 12 May 2012, 01:50
ArsenalNut wrote:Here's a quote from Apache's Subversion Best Practices webpage from the Know when to create branches sectionI think this would the best branching model for the Forge project to adopt.SVN.Apache wrote:The Branch-When-Needed system
(This is the system used by the Subversion project.)
Users commit their day-to-day work on /trunk.
Rule #1: /trunk must compile and pass regression tests at all times. Committers who violate this rule are publically humiliated.
Rule #2: a single commit (changeset) must not be so large so as to discourage peer-review.
Rule #3: if rules #1 and #2 come into conflict (i.e. it's impossible to make a series of small commits without disrupting the trunk), then the user should create a branch and commit a series of smaller changesets there. This allows peer-review without disrupting the stability of /trunk.
Pros: /trunk is guaranteed to be stable at all times. The hassle of branching/merging is somewhat rare.
Cons: Adds a bit of burden to users' daily work: they must compile and test before every commit.
Looks good to me, but rule #1 may be somewhat extreme.
In the past there have been several occasions where someone meant to submit all of the files that they had changed/created but...
sometimes we accidentally leave out one of the pieces of our submission. This can result in a project that fails to build and run.
When this happens the team has been capable of noticing that there is a problem and we tend to work together as we try to rectify this situation.
Publicly humiliating the responsible person could make a bad situation worse by convincing them to leave the project. We should consider rewording rule #1.
-
Chris H. - Forge Moderator
- Posts: 6320
- Joined: 04 Nov 2008, 12:11
- Location: Mac OS X Yosemite
- Has thanked: 644 times
- Been thanked: 643 times
Re: Branch discussions
by ArsenalNut » 12 May 2012, 03:30
How about we just add aChris H. wrote:Publicly humiliating the responsible person could make a bad situation worse by convincing them to leave the project. We should consider rewording rule #1.

So many cards, so little time
-
ArsenalNut - Posts: 512
- Joined: 08 Jul 2011, 03:49
- Has thanked: 27 times
- Been thanked: 121 times
Re: Branch discussions
by Chris H. » 12 May 2012, 11:59
ArsenalNut wrote:How about we just add aChris H. wrote:Publicly humiliating the responsible person could make a bad situation worse by convincing them to leave the project. We should consider rewording rule #1.after the sentence? I didn't take the statement literally. I assumed it was the author trying to be funny sort of like "Management will continue the beatings until morale improves". I think the intent is to remind people to be careful not to break the trunk since the majority of the work is done there.
Yeah, I suspected that this was just a Dilbert like joke.

Your point that we do not want to break the trunk is a good one.
-
Chris H. - Forge Moderator
- Posts: 6320
- Joined: 04 Nov 2008, 12:11
- Location: Mac OS X Yosemite
- Has thanked: 644 times
- Been thanked: 643 times
Re: Branch discussions
by Chris H. » 13 May 2012, 22:58
ArsenalNut wrote:How about we just add aafter the sentence?
I have a first draft for a re-write for rule #1.
Rule #1: /trunk must compile and pass regression tests at all times. We have had several commits to the SVN trunk in the past which broke the trunk and it would not successfully compile and run.
Your local copy may compile and run but a commit to the SVN trunk may fail to push all of your new material to the SVN. This will leave the truck in a state where some of your new material is missing and this can break the trunk.
We also have had several instances where a commit will compile and run on some computers but not others. Your code may not be compatible with some versions of java and code that runs correctly on the Windows OS may sometimes fail to work correctly when run under the Mac OS.
-
Chris H. - Forge Moderator
- Posts: 6320
- Joined: 04 Nov 2008, 12:11
- Location: Mac OS X Yosemite
- Has thanked: 644 times
- Been thanked: 643 times
Re: Branch discussions
by ArsenalNut » 14 May 2012, 15:07
I added a step-by-step for updating a branch from the trunk to the Wiki. Someone suggested that the branch information doesn't really belong under the installation section. I think it makes sense to move this information under "Working with the project". The new section organization could be
3.X Branches
I still need to write the step-by-step for branch reintegration.
3.X Branches
I still need to write the step-by-step for branch reintegration.
So many cards, so little time
-
ArsenalNut - Posts: 512
- Joined: 08 Jul 2011, 03:49
- Has thanked: 27 times
- Been thanked: 121 times
Re: Branch discussions
by Chris H. » 14 May 2012, 15:53
We have a section named "3.5 Committing changes to the repository". There is a brief warning to not commit code with errors.
The new branches section appears to be similar in purpose and could possibly become a new 3.7 section.
The new branches section appears to be similar in purpose and could possibly become a new 3.7 section.
-
Chris H. - Forge Moderator
- Posts: 6320
- Joined: 04 Nov 2008, 12:11
- Location: Mac OS X Yosemite
- Has thanked: 644 times
- Been thanked: 643 times
14 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 45 guests