[PATCH 2 of 2] pull: new output message suggests better update action when a new branch head is added

Matt Mackall mpm at selenic.com
Tue Mar 15 22:42:48 CDT 2011


On Tue, 2011-03-15 at 21:17 -0400, Kevin Berridge wrote:
> Sorry, I'm making up wording as I go...
> 
> On Tue, Mar 15, 2011 at 8:49 PM, Greg Ward <greg at gerg.ca> wrote:
> 
> > On 15 March 2011, Kevin Berridge said:
> > > There are three different scenarios involving new branches:
> > >
> > > 1. no changes on your branch, new branch head added
> > > 2. changes on your branch but no new head, new branch head added
> > > 3. changes on your branch and new head, plus a new branch head added
> >
> > Hangonasec.  I thought we were talking about new heads on some (named)
> > branch, not about new named branches.  (Just in case there is
> > terminological confusion here, I am going to explicitly say "named
> > branch" when I mean "named branch".)
> >
> 
> You're right, we haven't (yet) been talking about new branches, just new
> branch heads.  And that's probably all we care about.
> 
> 
> >
> > > If we want the message to favor information about your current branch
> > maybe
> > > there should be three messages like:
> > >
> > > 1: (No changes on this branch, but new branch heads added. Run 'hg
> > branches'
> > > to see branches)
> >
> > Disagree.  IMHO the only time it's appropriate to recommend "hg
> > branches" is if a new named branch has appeared.  If I'm working on
> > branch 1.1 and someone just added changesets (or increased the head
> > count) on default, I don't really care.  It doesn't affect me right
> > now.  Just tell me "new heads on another branch".  Bonus points for
> > "new heads on branch 'default'", but that is strictly optional.
> >
> 
> I like "new heads on other branches."  I struggled w/ this case because as
> you say, we don't really care about the other branches.
> 
> 
> >
> > > 2: (Changes on this branch, and new branch heads added. Run 'hg update'
> > to
> > > get latest working copy, 'hg branches' to see branches)
> >
> > "hg branches" is even less relevant here.  What I want to know is,
> > what are the heads on the current branch?  The answer can be had by
> > running "hg heads .".
> >
> 
> In this case there is only one head on the current branch, but there are new
> heads on other branches.  The most likely next action is hg update, to get
> to the latest version on the current branch.  This message could simply be
> "Changes on this branch, run 'hg update' to get latest working copy"?
> 
> 
> >
> > > 3: (New heads on this branch, and new branch heads added. Run 'hg heads'
> > to
> > > see heads, 'hg merge' to merge, 'hg branches' to see branches)
> >
> > That's redundant, or I'm confused.  What is the difference between
> > "new heads on this branch" and "new branch heads added"?  Is the
> > second one referring to *other* named branches?
> >
> 
> In this case there are new heads on the current branch, and you probably
> want to merge.  This message could be shortened to "New heads on this
> branch, run 'hg merge' to merge".

This is about where it becomes useful to enumerate all possible outcomes
in a table.

                    current named branch
                no new heads     new heads
overall
no new heads     update           [1]
new heads           [2]           [3]
new branches        [4]           [5]

What messages should we get for 1, 2, and 3? I suspect 1 == 3, but we
probably want a different non-empty message for 2. Not sure about 4 and
5.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list