Enable "hg push --new-branch" by default in hgrc

Martin Geisler mg at aragost.com
Thu Mar 24 09:34:37 CDT 2011


Mads Kiilerich <mads at kiilerich.com> writes:

> On 03/24/2011 03:02 PM, Dominik Psenner wrote:
>> We're working a lot with named branches to keep track of bug-related
>> fixes. We push those changes also to our master repository as we want
>> that information to become historical.
>>
>> The odd thing about this is that we have to type --new-branch almost
>> for every push we do, so it would be natural to enable it by default.
>> Unfortunately this is the only thing I was able to come up with and
>> I'm worried having this in my hgrc could be dangerous:
>>
>> -- quote
>> [alias]
>> push = push --new-branch
>> -- quote
>>
>> What do you guys think about making --new-branch configurable in hgrc
>> without the need of an alias definition?
>
> The reasons why an alias could be dangerous and a bad idea also
> applies to making it configurable in other ways. You can use defaults,
> even though it has been deprecated for exactly the same reasons.
>
> Is it really a problem that you have to specify --new-branch? It could
> be argued that it is especially good for you because you make so many
> branches and so easily can push a branch that shouldn't have been
> pushed anyway.

I would counter that you don't have that many options: if you've created
the branch, then you'll want to push it sooner or later since we don't
really have a good way of abandoning a branch (except dead heads..).

-- 
Martin Geisler

aragost Trifork
Professional Mercurial support
http://aragost.com/en/services/mercurial/blog/


More information about the Mercurial-devel mailing list