[PATCH 2 of 3]: update: don't lose active bookmark when updating to the "." revision

Martin von Zweigbergk martinvonz at google.com
Tue Nov 10 05:55:44 CST 2015


On Nov 10, 2015 01:25, "Waldemar Kornewald" <wkornewald at gmail.com> wrote:
>
> On Nov 10, 2015 00:56, "Gregory Szorc" <gregory.szorc at gmail.com> wrote:
> >
> > I frequently use `hg up .` to deactivate the current bookmark because
it is less typing than `hg book -i`. I concede I probably shouldn't be
doing this. But I'm lazy and a power user. I'm -0 on this patch because it
changes my workflow.
> >
>
> I'd really like to know, why do you deactivate bookmarks, at all?

I do it to avoid updating the bookmark. Sometimes I have @ checked out and
I want create a commit and send it to the mailing list.

> Also, why do you stay on the same revision? Why not do all development
> with bookmarks?

Especially if it's just a single commit, there is not much reason to create
a bookmark for it.

>
> In Git you even get a big warning (you're in detached mode) whenever
> you deactivate a branch.

That's because git will gc commits that are not pointed to by anything. Hg
does not gc.

>
> We always mark our main branch with an @ bookmark because otherwise
> clone, pull -u, and update would switch to tip - which is some
> arbitrary branch. Also, introducing bookmarks in a later step needs to
> be coordinated with all developers (so they all hg up @). It's really
> unfortunate that bookmarks are such a second-class citizen (not used
> by default, not enforced like in Git).

I used git for many years (and contributed to the project) before my
current project made me work on hg. When I switched to hg, my initial
reaction was to use bookmarks all the time, just like I was used to using
branches with git. Soon, I had gotten used to commits not getting gc'd and
I stopped using bookmarks for simple changes. After a bit longer, when I
still used bookmarks for larger features, I would sometimes realize there's
a better way of doing part of the feature and I would check out a commit or
two from the tip, make another commit it two and have a new topological
branch without a bookmark. Frequently, that new branch turned out to really
be better, and I would have to move the bookmark and strip/obsolete the
previous attempt. This happened frequently enough that the benefit of
having a label for the feature seemed smaller than the cost of updating
where it pointed to. I almost never use bookmarks anymore. I have not felt
that I have trouble finding commits.

I'm now trying out the experimental "topic" extension, which lets you label
a feature without the trouble of moving the label between tips of the
feature branch.

I never use -u with pull. And I haven't collaborated on a shared bookmark.

>
> Greetings,
> Waldemar
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20151110/74e7847d/attachment.html>


More information about the Mercurial-devel mailing list