Smoothing out bookmarks

Matt Mackall mpm at selenic.com
Thu May 17 09:22:44 CDT 2012


On Tue, 2012-05-15 at 23:45 -0500, Kevin Bullock wrote:
> In IRC this afternoon (US/Central) we were discussing various aspects
> of bookmarks, and how to finally tighten up the experience of using
> them. I've submitted a patch to make a bookmark called '@' the update
> target for clone if it exists, but several other issues need to be
> considered to make the whole experience smooth. For starters, here's a
> few questions I was considering regarding the special @ bookmark:
> 
> 1. Should a bare update go to @ if it exists (and we're not on a named branch)?

No. The '@' bookmark would have similar semantics to the default branch.
In other words, it's what clone checks out by default, and that's all.

> 2. Would it be sensible to have @ be on a named branch other than default, or would this lead to madness?
>     a. What about allowing a per-branch default bookmark?
>     b. What should a per-branch default bookmark be called? 'foo@' would be the most obvious, but seems klunky. If this bookmark diverges, we end up with bookmarks named things like 'foo@@1'.
> 
> 3. What about the case where there's no bookmarks on a branch, and suddenly an experimental one appears?
> 
> To elaborate on (3), Matt posed the following problem: Alice and Bob
> are working on a branch. Alice updates to the branch head and commits,
> then starts some experimental work. She commits and bookmarks her work
> as alice-work. When Bob pulls and updates, he should move forward one
> commit. Instead he gets everything in alice-work, which is now the
> branch head.
> 
> To solve this, I suggested automatically creating a "default" bookmark
> when an explicit bookmark is created on a branch with no other
> bookmarks (or perhaps even simply if there's no active bookmark). I
> say "default" in quotes because this should almost certainly not be
> the same as the per-branch default discussed in (2) above. This
> implicit-default bookmark would be as invisible as possible. If there
> is an explicit default bookmark (say foo@), then the implicit
> "default" bookmark would not be created.
> 
> Does this seem reasonable? I'll think more about this and propose a
> specific design, but want to get comments early.

I'm not sure how interesting the whole @ thing is, but (3) seems to be
pretty important in getting bookmarks to be usable in an ad hoc fashion.
Right now, you can set up everything to use bookmarks only and have a
working system, but if you want to primarily use named branches with
occasional bookmarks, things can go wrong.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list