[RFC] warn people about the permanence of branches

timeless timeless at gmail.com
Mon Dec 5 23:19:08 CST 2011


What if we had a file ".hgbranchnaming" whose tip rules controlled
warning free branch names.

It could support regexp/glob/static.

No file = warn for all

A file with just "stable" would warn for any other names.

A file with "glob:rel-*" would allow any rel- branches but nothing
else (without warnings).

The file could be generic to apply to both tags and branches with
sections, or there could be two.

On 12/5/11, Matt Mackall <mpm at selenic.com> wrote:
> On Mon, 2011-12-05 at 19:59 -0600, Augie Fackler wrote:
>> On Dec 5, 2011, at 5:22 PM, Matt Mackall wrote:
>> >
>> > Looks like our efforts to alert people exposed to Git to the permanence
>> > of branches in non-Git systems need help. I propose:
>> >
>> > diff -r 09b200396384 mercurial/commands.py
>> > --- a/mercurial/commands.py	Mon Dec 05 17:09:11 2011 -0600
>> > +++ b/mercurial/commands.py	Mon Dec 05 17:12:10 2011 -0600
>> > @@ -855,6 +855,8 @@
>> >                                  hint=_("use 'hg update' to switch to
>> > it"))
>> >         repo.dirstate.setbranch(label)
>> >         ui.status(_('marked working directory as branch %s\n') % label)
>> > +        ui.warn(_('warning: branches are permanent and global,'
>> > +                  ' did you want a bookmark?\n'))
>>
>> Perhaps we could be smarter about this and only do it if branches other
>> than default don't already exist in the repo?
>
> I expect many repos to have a small number of "official" branches (ie
> the two we use), so I don't think this really helps. Even if we set the
> threshold at 10, I think larger projects would still suffer from
> mis-clued devs adding their own personal branches.
>
> --
> Mathematics is the supreme nostalgia of our time.
>
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
>

-- 
Sent from my mobile device


More information about the Mercurial-devel mailing list