2

Is there any way to get the logs from a bazaar repository (like with bzr logs -v), but with only the commit messages.

By default, for each commit, you have:
revision number
committer name
branch nick
timestamp
message
files modified.

I would like just the messages.


Some context, in case there is an other way to do what I want:
When I write release notes, I get the commit messages up to the last released version. Before rewriting the commit messages in user friendly english, I need to filter all the other elements. This is boring, and I'd prefer the computer to do it for me :)

Guillaume
  • 21,685
  • 6
  • 63
  • 95

1 Answers1

4

bzr log --short, bzr log --line, bzr log --gnu-changelog or just bzr log --gnu.

See bzr log --usage and also bzr help log-formats.

One can add custom log formatter via plugin.

bialix
  • 20,053
  • 8
  • 46
  • 63
  • --line is dangerous, because I only get the first line of my commit. --short is almost what I want, but for each commit I still get the " ". Any way to remove that? – Guillaume Oct 04 '12 at 09:27
  • @Guillaume you have to write a plugin to provide a custom log formatter. – bialix Oct 05 '12 at 12:33
  • @Guillaume try also `bzr log --gnu` – bialix Oct 05 '12 at 12:34
  • 1
    Or run the `bzr log --short` output through a text filter like perl or awk. – dOxxx Oct 05 '12 at 12:35
  • @bialix It does not produced desired effect (still get date and commiter details). – Guillaume Oct 05 '12 at 13:18
  • @dOxxx I thought about it, but what criteria do I use to filter the lines I don't want? I could work on the --xml output, but seems overkill for my need. – Guillaume Oct 05 '12 at 13:19
  • I realize this won't help in your current situation, but I find using a git-style commit message policy helps -- first line is a summary of changes, blank line, then more details if necessary. Also described here: http://stackoverflow.com/questions/2290016/git-commit-messages-50-72-formatting – dOxxx Oct 05 '12 at 15:48
  • 1
    As for solving your current problem, grep is your friend: `bzr log --short | grep -Ev '^ *[0-9]+ [[:alpha:] ]+'` – dOxxx Oct 05 '12 at 15:57