command to get annotation for one line

Bug #153191 reported by Martin Pool
2
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Wishlist
Unassigned

Bug Description

It seems common to just want the annotation for a particular known line, with eg

  bzr annotate foo.py +344

and that should just show the log entry for the relevant revision. You could usefully bind this into an editor.

Martin Pool (mbp)
Changed in bzr:
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
John A Meinel (jameinel) wrote :

That does indeed seem useful. Though would:
bzr annotate --lines 344-344 foo.py
or
bzr annotate --line 344 foo.py

Be more appropriate?

I guess we can leave it up to whoever implements it. I'm just more of a options versus free arguments sort of person.

Revision history for this message
Aaron Bentley (abentley) wrote : Re: [Bug 153191] command to get annotation for one line

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Martin Pool wrote:
> Public bug reported:
>
> It seems common to just want the annotation for a particular known line,
> with eg
>
> bzr annotate foo.py +344
>
> and that should just show the log entry for the relevant revision. You
> could usefully bind this into an editor.

Alternatively, it could be a revision spec:

bzr log -r origin:foo.py+344

Which would also support
bzr cat foo.py -r origin:foo.py+344

and

bzr diff -c origin:foo.py+344

And can we please put feature requests on the list, not the bug tracker?
 At least for initial discussion?

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHFNpw0F+nu1YWqI0RAmVyAJ9djkiIXmqyTyqnDdTyCq0NyUMgOACeJ1ih
rldOjFXyhXoI8nvDD3zIYi4=
=spAK
-----END PGP SIGNATURE-----

Revision history for this message
Vincent Ladeuil (vila) wrote :

>>>>> "aaron" == Aaron Bentley <email address hidden> writes:

    aaron> Martin Pool wrote:
    >> Public bug reported:
    >>
    >> It seems common to just want the annotation for a particular known line,
    >> with eg
    >>
    >> bzr annotate foo.py +344
    >>
    >> and that should just show the log entry for the relevant revision. You
    >> could usefully bind this into an editor.

    aaron> Alternatively, it could be a revision spec:

    aaron> bzr log -r origin:foo.py+344

Err, foo.py+344 is a legal file name.

<snip/>

    aaron> And can we please put feature requests on the list,
    aaron> not the bug tracker? At least for initial discussion?

CC added.

Revision history for this message
James Westby (james-w) wrote :

On (16/10/07 06:45), Martin Pool wrote:
> Public bug reported:
>
> It seems common to just want the annotation for a particular known line,
> with eg
>
> bzr annotate foo.py +344
>
> and that should just show the log entry for the relevant revision. You
> could usefully bind this into an editor.
>

Another approach might be

  bzr ann foo.py -L123,456

to annotate those lines.

Thanks,

James

--
  James Westby -- GPG Key ID: B577FE13 -- http://jameswestby.net/
  seccure key - (3+)k7|M*edCX/.A:n*N!>|&7U.L#9E)Tu)T0>AM - secp256r1/nistp256

Revision history for this message
Aaron Bentley (abentley) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Vincent Ladeuil wrote:
>>>>>> "aaron" == Aaron Bentley <email address hidden> writes:
>
> aaron> Martin Pool wrote:
> >> Public bug reported:
> >>
> >> It seems common to just want the annotation for a particular known line,
> >> with eg
> >>
> >> bzr annotate foo.py +344
> >>
> >> and that should just show the log entry for the relevant revision. You
> >> could usefully bind this into an editor.
>
> aaron> Alternatively, it could be a revision spec:
>
> aaron> bzr log -r origin:foo.py+344
>
> Err, foo.py+344 is a legal file name.

Yes, but only Tom Lord uses + in filenames. :-P

Well, we could do: "origin:344:foo.py". That way, the filename can
include colons. But it would be nice to do foo.py:344, because many
tools spit out line number info in that order.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHFO4O0F+nu1YWqI0RAlVOAJ0aORtchD08jPw4F/KnjlVTuvhCoQCeIZ6e
WzAayMSUJ/OqDFdhZYEevL8=
=2PkW
-----END PGP SIGNATURE-----

Revision history for this message
John A Meinel (jameinel) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Vincent Ladeuil wrote:
>>>>>> "aaron" == Aaron Bentley <email address hidden> writes:
>
> aaron> Martin Pool wrote:
> >> Public bug reported:
> >>
> >> It seems common to just want the annotation for a particular known line,
> >> with eg
> >>
> >> bzr annotate foo.py +344
> >>
> >> and that should just show the log entry for the relevant revision. You
> >> could usefully bind this into an editor.
>
> aaron> Alternatively, it could be a revision spec:
>
> aaron> bzr log -r origin:foo.py+344
>
> Err, foo.py+344 is a legal file name.
>
> <snip/>
>
> aaron> And can we please put feature requests on the list,
> aaron> not the bug tracker? At least for initial discussion?
>
> CC added.
>
>

Well, under Unix the only illegal character in a path is '\0', IIRC. And '/' is
considered a directory separator. Which means that there are no possible
characters we could use that could never be used in a filename.
I don't think we need to support all of them, though.

At one point we were using branch/@XXX to define a revision number, I suppose
we could make it file/@+344 or some other hideous thing.

I think Aaron has a point for "foo.py:344". We can always make the parser chop
off the last colon, so:

foo.py:other:name:to:use::344

Would think we were asking about line 344 in 'foo.py:other:name:to:use:'

Of course, ':' has a special meaning on Mac, since it *used* to be the
directory separator. So if you go to the Finder, you can create a file named
"foo/py". And if you use the Terminal and ls it, it will show up as "foo:py".
Good stuff. I just love the Mac filesystem, it is my bestest friend.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHFO82JdeBCYSNAAMRAjMFAJoCJU5KYSx6vfsuAOuy8FawhythzACgkkNZ
poNMd2l7xF+t3dfNu+27MQc=
=re5k
-----END PGP SIGNATURE-----

Revision history for this message
Alexander Belchenko (bialix) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Aaron Bentley пишет:
> Vincent Ladeuil wrote:
>>>>>>> "aaron" == Aaron Bentley <email address hidden> writes:
>> aaron> Martin Pool wrote:
>> >> Public bug reported:
>> >>
>> >> It seems common to just want the annotation for a particular known line,
>> >> with eg
>> >>
>> >> bzr annotate foo.py +344
>> >>
>> >> and that should just show the log entry for the relevant revision. You
>> >> could usefully bind this into an editor.
>
>> aaron> Alternatively, it could be a revision spec:
>
>> aaron> bzr log -r origin:foo.py+344
>
>> Err, foo.py+344 is a legal file name.
>
> Yes, but only Tom Lord uses + in filenames. :-P

I'm not Tom and not Lord, but I also sometimes use plus sign in filenames.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHFPSszYr338mxwCURAhQXAJ4xkm74eG1QkP27APWsxD2vB/GVxgCbBZ08
rYtYLu4pNdAcB00+QK2RFwk=
=EPl0
-----END PGP SIGNATURE-----

Revision history for this message
Martin Pool (mbp) wrote :

> Alternatively, it could be a revision spec:
>
> bzr log -r origin:foo.py+344
>
> Which would also support
> bzr cat foo.py -r origin:foo.py+344

That would be interesting, meaning 'the revision which modified that
line'. Though you'd almost want to be able to chain them to get 'the
revision which last modified line 344 in revision xxx'.

--
Martin

Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.