[RFC] warn people about the permanence of branches

Kevin Bullock kbullock+mercurial at ringworld.org
Tue Dec 6 14:08:17 CST 2011


On Dec 6, 2011, at 1:40 PM, Matt Mackall wrote:

> On Tue, 2011-12-06 at 10:59 -0600, Kevin Bullock 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'))
>>>    else:
>>>        ui.write("%s\n" % repo.dirstate.branch())
>> 
>> 
>> Can I get a way to shut this warning _off_? Something like:
>> 
>> [ui]
>> yesireallyunderstandnamedbranchesandtheiruses = True
> 
> If you do understand branches, can't you just ignore the warning? But
> perhaps it should be at status level hint instead:
> 
> $ hg branch foo
> marking working directory as branch foo
> (branches are permanent and global, did you want a bookmark?)

If it's hint-level, I can ignore it easily enough. Warnings stick out prominently among streams of console output; my eyes have been trained by years of *nix usage. Having this as a warning seems wrong to me, since it should be merely a step in the process of learning how hg works. It's not warning you off of something that's inherently a bad idea.

I also agree with Arne, though, that it might be better phrased as "use bookmarks as short-lived markers" or something similar.

pacem in terris / мир / शान्ति / ‎‫سَلاَم‬ / 平和
Kevin R. Bullock

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20111206/19504ed0/attachment.html>


More information about the Mercurial-devel mailing list