JDK 9 Sandbox Development Forest
Stuart Marks
stuart.marks at oracle.com
Tue Dec 16 16:43:43 UTC 2014
On 12/16/14 2:51 AM, Chris Hegarty wrote:
> On 16 Dec 2014, at 03:01, Wang Weijun <weijun.wang at oracle.com> wrote:
>> Is it easy to push anything to the default branch if I am mostly working on my own branch? Also, is there a server-side hook that rejects such pushes?
>
> There is no hook preventing pushes to the default branch. Please be careful.
>
> If this becomes an issue over time, then we can look at the possibility of adding such a hook. I would like to get some experience with using branches and see how it goes before deciding if this is necessary.
Right. Fortunately, once you're working on a branch, the branch is "sticky" and
subsequent commits will remain on the same branch. With no argument, "hg update"
will update to the head of the current branch. You'll only switch branches if
you explicitly switch branches using "hg update <otherbranch>" or give a
specific rev that happens to be on another branch.
If, however, you say "hg update tip" you might be updated to some arbitrary
branch, perhaps the default branch or even somebody else's. The reason is that
the "tip" is simply the latest changeset in the repository, and it is not
attached to any particular branch.
For this reason I recommend avoiding "hg update tip" if you've been in the habit
of doing this.
To avoid accidentally pushing something to the default branch, I'd recommend
that the first thing you do after cloning the sandbox is either to create your
own branch or update to an existing non-default branch. That way, your next push
won't go on the default branch.
s'marks
More information about the jdk9-dev
mailing list