wishlist: show line numbers in annotate output
Alexander Belchenko
bialix at ukr.net
Wed Feb 28 15:21:48 GMT 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I'd like to propose new flag for annotate command: --show-line-numbers
or --line-numbers. With this flag annotate output should include
number for each line. Per example, standard output without line
numbers:
50 mbp at sou | #! /usr/bin/env python
32 mbp at sou |
2288.1.3 mbp at sou | # Copyright (C) 2005, 2006, 2007 Canonical Ltd
1887.1.1 dato at ne | #
32 mbp at sou | # This program is free software; you can redistribute it and/or modify
| # it under the terms of the GNU General Public License as published by
| # the Free Software Foundation; either version 2 of the License, or
| # (at your option) any later version.
1887.1.1 dato at ne | #
32 mbp at sou | # This program is distributed in the hope that it will be useful,
| # but WITHOUT ANY WARRANTY; without even the implied warranty of
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
| # GNU General Public License for more details.
1887.1.1 dato at ne | #
32 mbp at sou | # You should have received a copy of the GNU General Public License
| # along with this program; if not, write to the Free Software
| # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1887.1.1 dato at ne |
1861.2.6 bialix@ | """Bazaar -- a free distributed version-control tool"""
1724.2.1 john at ar |
| import os
| import sys
And now with line numbers:
50 mbp at sou | 1| #! /usr/bin/env python
32 mbp at sou | 2|
2288.1.3 mbp at sou | 3| # Copyright (C) 2005, 2006, 2007 Canonical Ltd
1887.1.1 dato at ne | 4| #
32 mbp at sou | 5| # This program is free software; you can redistribute it and/or modify
| 6| # it under the terms of the GNU General Public License as published by
| 7| # the Free Software Foundation; either version 2 of the License, or
| 8| # (at your option) any later version.
1887.1.1 dato at ne | 9| #
32 mbp at sou | 10| # This program is distributed in the hope that it will be useful,
| 11| # but WITHOUT ANY WARRANTY; without even the implied warranty of
| 12| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
| 13| # GNU General Public License for more details.
1887.1.1 dato at ne | 14| #
32 mbp at sou | 15| # You should have received a copy of the GNU General Public License
| 16| # along with this program; if not, write to the Free Software
| 17| # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1887.1.1 dato at ne | 18|
1861.2.6 bialix@ | 19| """Bazaar -- a free distributed version-control tool"""
1724.2.1 john at ar | 20|
| 21| import os
| 22| import sys
Use case:
I run the script and found the problem, and python traceback usually points me to
the line number. (For C-code compilation error also points to some line number).
I want to see annotation of the file with error. I run
$ bzr ann file | less
and then I have no reference point where what line is.
I know I can type line number and 'g' and less jump to selected line.
But when requested line is near to the end of file, there is no
easy way to actually calculate where requested line is.
- --
Alexander
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFF5Z4LzYr338mxwCURAqt9AJ40IZCk8p+4GyhRQajhIna14Jo1qACdFx4F
4EwfI6ssOaXiXK+ywKi2NuM=
=w08N
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list