Making it easy to really create private local branching

dukeofgaming dukeofgaming at gmail.com
Mon Jan 7 00:38:21 CST 2013


On Sun, Jan 6, 2013 at 6:49 PM, Pierre-Yves David <
pierre-yves.david at ens-lyon.org> wrote:

>
> On 7 janv. 2013, at 01:17, dukeofgaming wrote:
>
> > Hi,
> >
> > I was thinking that some like the way branching works in git because of
> this: private local branching.
> >
> > I've seen some complain "but Mercurial pushes everything by default!,
> that makes me sad", and "to have private local in branching in mercurial
> you have to copy your whole project or create another clone!", which to me
> is a silly option, but I see it still sticks around due to cultural factors.
> >
> > Then there are Mercurial Phases to do this, but it is slightly
> cumbersome IMHO, enough to somewhat discourage their use:
> >
> > # hg branch my_branch
> > # hg commit -m "Opening branch"
> > # hg id -n
> > 123
> > # hg phase --secret --force 123
>
> The `hg id` is unneeded here:
>

Not unless you use the GUI or somehow are able to guess the next revision
number. So `hg id` is necessary for usability reasons IMHO.


>
>   $ hg branch my_branch
>   $ hg commit -m "Opening branch"
>   $ hg phase --secret --force 123
>
> The phase call could be avoided too:
>
>   $ hg branch my_branch
>   $ hg commit -m "Opening branch" --config phases.secret=True
>

That is nice to know, however it looks verbose and obscure, like Git :P


>
> > And you have a private local branch, yes?
> >
> > So how about if instead we had a --phase option in branch:
> >
> > # hg branch my_branch --phase secret
>
> Meh. I supported the idea to have `hg phase` works as hg branch
>
> $ hg branch babar
> -> next commit on branch babar
> $ hg phases secret
> -> next commit in phase secret
>
> But Matt does not likes this proposal because he does not like stateful
> commands.
>

Yeah, I kind of agree, you would need something to indicate that the repo
was left at that state.

Like that usability book says on it's title: "Don't make me think"


>
> > So that the next commit on that branch would be secret (and the rest as
> a consequence). Or even better, in commit, that way we don't have to use
> --force for brand new commits after the fact.
> >
> > # hg branch my_branch
> > # hg commit -m "Opening secret branch" --phase secret
>
> I'm not fan of adding new flag on commit.
> `--phase XXX` is better than `--config phases.new-commit` but still not
> very sexy.
>

Remember that "--something" can be also put as "-s" at the same time, and
the shorter ones are the one that get used more, like `-m` for `--message`

So we could have `-p secret`


>
> > Or even, even better, how about both?, what do you think?
>
> I think we need a simpler way to create secret commit. I'm not fully
> convinced by your proposal. But thanks to feeding the discussion with new
> proposal and use case.
>

NP, I try to leave my thoughts here every time I think there is a way to
make Mercurial even more enjoyable. I also use Git a little, but don't
enjoy it as much, so every time I suggest something I do so thinking that
"X would make Mercurial more appealing than git"

I think the key user story here is:

    As a user, I want to make a secret revision purely in the CLI
    without having to force it with the phase command, and without
    having to go and check for the ID of the commit I just did.

Regards,

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20130107/a56eb66c/attachment.html>


More information about the Mercurial-devel mailing list