Why you don't want to allow disabling "branches are global and permanent, did you want a bookmark"?

Adrian Buehlmann adrian at cadifra.com
Fri Aug 10 08:12:19 CDT 2012


On 2012-08-08 20:46, Adrian Buehlmann wrote:
> On 2012-08-08 18:44, Matt Mackall wrote:
>> On Wed, 2012-08-08 at 11:49 +0400, vitalif at yourcmc.ru wrote:
>>> Hello!
>>>
>>> As I've already mentioned (several times :-D) in Bug 3321 
>>> (http://bz.selenic.com/show_bug.cgi?id=3321),
>>
>> Indeed you have, and you got a number of definitive responses there. Why
>> should I even read this thread when it seems its point is simply to try
>> to gather popular support for a solution that I've already rejected? If
>> I were the type of project leader who accepted solutions I didn't like
>> just because they were popular.. we'd all be using Git.
>>
>> If you want to make forward progress, suggest a solution that hasn't
>> been definitively rejected. For instance, I don't know.. how about
>> automatically suppressing the message in repos that already have 10
>> branches? That's probably sufficiently n00b-proof, while getting out of
>> the way of heavy branch users.
> 
> How about:
> 
> diff --git a/mercurial/commands.py b/mercurial/commands.py
> --- a/mercurial/commands.py
> +++ b/mercurial/commands.py
> @@ -912,8 +912,8 @@
>                                       hint=_("use 'hg update' to switch to it"))
>              repo.dirstate.setbranch(label)
>              ui.status(_('marked working directory as branch %s\n') % label)
> -            ui.status(_('(branches are permanent and global, '
> -                        'did you want a bookmark?)\n'))
> +            ui.status(_('(the branch name will be permanently recorded '
> +                        'on commit)\n'))
>      finally:
>          wlock.release()
> 
> Which looks like this:
> 
>   $ hg branch foo
>   marked working directory as branch foo
>   (the branch name will be permanently recorded on commit)
> 
> Instead of (currently):
> 
>   $ hg branch foo
>   marked working directory as branch foo
>   (branches are permanent and global, did you want a bookmark?)

Apologies for filibustering (see my other replies in this thread), but I
just had an interesting in-person discussion about this off-list with
someone else. I think a somewhat interesting aspect that wasn't
mentioned yet came up during that discussion:

The current output of the command is (as we know, let me just repeat it
here again):

  $ hg branch foo
  marked working directory as branch foo
  (branches are permanent and global, did you want a bookmark?)

If that message ("did you want a bookmark?") would help those purported
git-refugees (who don't read help tests, apparently), then that hint
would be _too late_ anyway at that point.

The branch 'foo' has already been set when they see that "warning". If
they don't know what they do, they will commit anyway (and thus set the
branch). I don't think a user who doesn't read help texts before using
commands will be able to get rid of that branch.

Long story short: I think there is no alternative to reading help texts
(in this case).



More information about the Mercurial-devel mailing list