On 5/15/13 12:41 PM, Marcus Brubaker wrote:
> On Wed, May 15, 2013 at 11:44 AM, Ben Goodrich <
goodri...@gmail.com> wrote:
>> On Wednesday, May 15, 2013 11:17:59 AM UTC-4, Bob Carpenter wrote:
>>>
>>>
>>> dev -> master: non-patch release
>>
>>
>> this would probably entail a nonminimal bump of the version number
>
> So technically the gitflow process says only release branches get
> merged to master. In other words:
>
> 1. Merge/commit new features/bug fixes in the dev branch, until dev
> settles down and we're ready to make a release.
>
> 2. Branch from dev to create a release N+1 branch, update docs/version
> numbers/etc, run full battery of tests and create release.
>
> 3. Merge release branch back into master.
>
> A hotfix would instead branch directly off of master instead of dev.
That's my understanding of the process, and I finally understand
why it makes sense now that we have so many different branches
of development.
>>> We know we want master to be stable and in an always-releasable
>>> state. But it brings up some questions:
>>>
>>> 1. How sloppy can we be on the feature branches?
We want to keep the commits organized and/or rebase them.
I'm still a little hazy on the arguments pro and con here.
If we keep the branches and *don't allow fast-forward*, won't
that still support bisect in the cases where you don't have
good commits on the branch?
>>> 2. How sloppy can we be on the dev branch?
Not at all. We want things to go onto the dev branch when they
work. If they don't work, they get kicked off the dev branch
until they do.
>>> 3. How much testing do we do for each commit?
Same question as 1. The commits are on the feature branches.
>>> 4. How much testing do we do for each merge?
Same question as 2. Enough to keep dev in working order.
Assuming we test everything on whatever our local setup is
before merging with dev, then the only issues likely to come
up are (a) race conditions with other merges, and (b) incompatibility
with other platforms/optimization levels.
I'm still not sure how to deal with that.
>>> I think in particular, we've been very sloppy at the commit level
>>> compared to the recommended git practices. I find the bisect argument
>>> and log-scanning arguments persuasive.
>>
>>
>> We certainly can't be sloppy at all on a hotfix branch, nor a merge from
>> development into master. The development branch doesn't need to be in a
>> releasable state always, but its history will become part of master's
>> history eventually. So, I still think you want to make sure each commit is
>> sound, although maybe not obsessing about whether it works on all platforms,
>> toolchains, optimization levels, etc. With a feature branch, you can be
>> "sloppy" initially because no one should be branching from a feature branch
>> (feature branches branch from the development branch). So, you can implement
>> a feature in a feature branch and rewrite your history before merging it
>> into the development branch. But it is easier to get things right the first
>> time ...
So does that mean the answer is "no", we won't be able to do bisect
unless we rebase our merges so that they look like single events?
Doesn't the branching w/o fastforward do that?
> Just so everyone is clear, we're really talking about two different
> things here. They're related and both of them should be addressed,
> but they are distinct.
>
> 1. The gitflow discussion relates to how we manage releases and the
> main Stan repository. What goes where, when and in what state. What
> do different branches mean, when do they merge, and in what direction,
> etc. In other words, how all of us work jointly on Stan.
Agreed. I'd also add
3 permissions. Who has permission to do what and what the code
review policies are before merges happen.
That is, do we make everything be a pull request that an admin
manages before the merge with dev happens?
I think we can all agree that we should be strict about what goes
into master and when.
4. code review. What is our process for reviewing code if any.
Does a third party have to sign off on a code review for every
pull request before an attempt is made to merge with dev and test?
The gitflow is agnostic on that point, and the minimal thing to do is
just let everything merge back into dev that passes all tests.
What I'm worried about specifically on this issue is new
features getting added without tests, as that seems to be happening
more and more often (I'm not trying to point fingers here --- I'm as
guilty as anyone of this; I was used to checkpointing regularly in
SVN this way, but it makes less sense in git to do this outside of
your own branch). For instance, some of the pending pull requests
are still pending because there aren't enough tests of the added
features.
Now what I'd like to be able to do is go into that pull request
and modify it to add the tests myself, wrap it up as another
> 2. The commit history discussion relates to how we work locally.
> Ideally every commit should build and, hopefully, pass unit tests. I
> think that's a good goal to keep in mind but a little overly
> optimistic, and perhaps even a little counter intuitive because it
> will lead to Balkanization of commits. I.E., instead of committing
> often with small changes, this encourages large block commits which
> have been fully vetted and makes git bisect similarly useless. (If it
> comes down to a single commit, but that commit touches dozens of files
> and changes hundreds of lines of code, that's not terribly helpful.)
We can be sloppy on this and fix it all up later by rebasing.
But what I'm wondering is whether that's necessary if we keep the
branch history as a branch instead of fast fowarding (that is, keep
it as a branch rather than merging its local commits into dev and
then into master).
> For 1) I like the gitflow process, it seems to makes sense, and
> ensures that we can always do a release with a bug fix if needed.
Agreed. I think I finally understand it.
> For 2) I see Ben has already posted something, but roughly speaking,
> it means before we do a git push, we should do a git rebase -i and
> clean up our commits. It's also probably a good idea to do the git
> rebase regularly for longer lasting feature branches to keep your
> history clean since doing a rebase at the end of a long development
> cycle can be painful and require a lot of manual merging.
Why does a rebase require any manual merging at all? Don't we just
compose the patches into one big patch?
Finally, there's the issue of where we set all of this up. Daniel
and I have been talking about isolating the dev and master branches
in something like stanfoo where only a couple people have permission
to control the merge, and then creating a new repository stanbar where
we actually work on all the branches. I'm still not sure the latter
will work if we have to clone a whole remote repository (i.e., all of
stanfoo) rather than just being able to branch from a remote branch
(i.e., branching from stanfoo/dev for features or stanfoo/master for
hotfixes).
- Bob