[MERGE] DWIM revspecs

Matthew D. Fuller fullermd at over-yonder.net
Sat Jul 25 20:20:37 BST 2009


On Sat, Jul 25, 2009 at 02:39:46PM -0400 I heard the voice of
Samuel Bronson, and lo! it spake thus:
> 
> Okay, so you explained why revid comes after tag, but why is branch
> after tag? Aren't those two rather likely to conflict?

Well, they're possibly the most likely pair, just because they're the
only two that the average user actually gets to pick.  On the other
hand, almost every branch is going to have a '/' in it, and most tags
probably won't.  But tag belongs ahead because:

1) The 'meat' of a branch spec (the path) is likely to be rather
   longish.  Much more so than a tag name.  So, the extra weight of
   typing the prefix if necessary is relatively smaller.

2) The tag: revspec is probably much more often used than the branch:,
   because
   a) the 'branch is a location' zeitgeist makes them less convenient
      to bang out a reference to,

   b) the same thing makes them look pretty ugly.  I mean, what the
      heck is THIS:

        % ~/src/bzr/revspec-dwim/bzr diff -r..../../../../B
        === removed directory 'a'
        === removed directory 'a/b'
        === removed directory 'a/b/c'
        === modified file 'foo'
        --- foo 2009-07-25 19:13:33 +0000
        +++ foo 2009-07-25 19:13:41 +0000
        @@ -0,0 +1,1 @@
        +foo

      Huh?  WHAT'S that path again?  Having it be
        % bzr diff -r..branch:../../../../B
      is clearer anyway.

   c) It's actually rather difficult to /use/ branch:.
      i) If one of the branches you're comparing is the one you're
         running bzr from, it actually blows up.
      ii) If I use stat instead of diff above...   well, that's even
          more fun.  If I use stat instead of diff with the DWIM
          revspec, it blows up on a ReadOnlyError.  If I use stat with
          an explicit branch:, it merely blows deprecation warnings at
          me from 0.91.  What the heck?

   d) And...   well...   for the things I'd use a revspec for, I'm
      just much more likely to be comparing against something in this
      branch, like a tag.  And of course, as well all know, everybody
      else works exactly like me.  Or maybe they don't, but tough for
      them, 'cuz I'm the one that wrote the patch   :)

3) And of course, looking up tags (in a branch you're already dealing
   with) is a lot quicker to test than digging up another branch,
   especially if it's non-local.


-- 
Matthew Fuller     (MF4839)   |  fullermd at over-yonder.net
Systems/Network Administrator |  http://www.over-yonder.net/~fullermd/
           On the Internet, nobody can hear you scream.



More information about the bazaar mailing list