-r 1-100 vs -r 1:100 vs ...

Michael Ellerman michael at ellerman.id.au
Sun May 29 04:34:34 BST 2005


On Sun, 29 May 2005 05:45, Erik Bågfors wrote:
> I love it, and yet I don't :)
>
> One problem is that I expect only one argument to follow -r. Simply
> because that's what I'm used to in almost all other programs.

I agree it's slightly unconventional, but that's a fairly hollow argument.

I expect my SCM to generally be a pain in the arse, because that's what I'm 
used to in almost all other programs. Should I make up a patch. :D

> bzr diff -r "1 to 10" etc, would make sence to me.

We could make that work too. But I don't see why the user should have to quote 
the arg when the program can work out what they mean without them.

Another reason is that requiring three top level args for the diff syntax 
allows you to use space in tags easily. eg.

bzr diff -r "bzr version 1.0" to "bzr version 1.1"

But you could make the parser smarter and work out that "1 to 10" should be 
split into ['1', 'to', '10'] and parsed again, but that makes 'to' a reserved 
word in tag names.

I think people will pretty quickly get the hang of typing:

bzr log -r 100 to 200

And you don't need a section in the manual to explain what it means =D

cheers

> /Erik
>
> On 5/28/05, Michael Ellerman <michael at ellerman.id.au> wrote:
> > Hi all,
> >
> > So I've been thinking about what the syntax for diff ranges should be. I
> > personally prefer using 1-100, because I think it's more obvious and it
> > means we don't need {}. But there's arguments both ways.
> >
> > Then I thought, hang on, why don't we just specify it using a
> > pre-existing and well understood "syntax"?
> >
> > And so we have:
> >
> > bzr diff -r 1 to 100
> >
> > English!
> >
> > We can also do:
> >
> > bzr log -r -10 to -5 -v
> > bzr diff -r 1 to now
> > bzr diff -r to date:yesterday
> > bzr diff -r start to
> > revid:michael at concordia-20050528165512-31af65114a1cdbd2
> >
> > and so on.
> >
> > I've implemented this on top of John's original patch to add x:y and all
> > the date and revid goodies. And there's also Rusty's diff range patch, so
> > you can actually use the revision ranges.
> >
> > Try it out.
> >
> > Or am I crazy?
> >
> > cheers
> >
> > --
> > Michael Ellerman
> > IBM OzLabs
> >
> > email: michael:ellerman.id.au
> > inmsg: mpe:jabber.org
> > wwweb: http://michael.ellerman.id.au
> > phone: +61 2 6212 1183 (tie line 70 21183)
> >
> > We do not inherit the earth from our ancestors,
> > we borrow it from our children. - S.M.A.R.T Person

-- 
Michael Ellerman
IBM OzLabs

email: michael:ellerman.id.au
inmsg: mpe:jabber.org
wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20050529/83003cfa/attachment.pgp 


More information about the bazaar mailing list