Confused about the output of 'bzr log --f --limit=X'

Kent Gibson warthog618 at gmail.com
Mon Dec 17 10:44:44 GMT 2007


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



Vincent Vertigo wrote:
> Hi,
>
> I am confused with the usage of 'log' command, when combining
> options 'forward' and 'limit'.
>
> First, using bzr from command-line, I find the 'forward / --f'
> option mandatory as soon as my branch exceeds 50 revisions: I am
> usually more interested in the log of my latest revisions, and it
> seems more logical to me in that chronological order.
> Am I the only one? Could it not be the default ordering, with
> replacement of option 'forward' with option 'backward'? (just
> wondering...).
I believe bzr log is designed to emit the logs you are most likely to
be interested in first, hence the most recent first as the default.
>
> What's more confusing to me is that, always using "bzr log --f", I
> have no use for option '--limit=X', as it limits the revision output
> to the first X revisions.
> From a system that Just Works :-) I would expect 'bzr log --f
> --limit=10' to output the latest 10 revisions from my branch.
>
You are correct that the --limit option does not make much sense with
the --forward option.  It is not meant to.

The purpose of the --limit option is to help out with a few corner
cases that are not well handled by bzr log -r<rev spec>.  e.g. the
long log formatter displays merge revisions as well as mainline so
this can make the number of revisions emitted unpredictable from a
user PoV.  Similarly, using a date based rev spec can produce an
unpredictable number of revisions.

For users interested in the first revisions emitted by bzr log, having
an unpredictable number of revisions logged can be an issue if you
can't use a pager for whatever reason - the revisions you are
interested in are the first to be lost by your shell's scrollback buffer.
For these cases the --limit option is handy to have.

If you use --forward and are interested in the most recent revisions
(i.e. those emitted last) then adding a --limit is pretty pointless.
I would suggest you just use an appropriate -r spec, such as
"-r-10..", and let your shell discard the oldest logs that you
probably aren't interested in.

Cheers,
Kent.


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

iD8DBQFHZlMcgoxTFTi1P8QRAmhYAJ9OL5p74e9Mpk2anfrFVJuD3z69BgCfcijn
MRD2gdrJUuchAcDYjDGnbJI=
=naIP
-----END PGP SIGNATURE-----



More information about the bazaar mailing list