1

I am using bash to try and get the last commit message of the most recent revision on a tree. In the documentation the closest thing I found was:

bzr log -l 1 --line

Which outputs:

45: Firstname Lastname 2013-11-20 some message here

I want to use bash regex to extract the message however the fact that the name field can be:

Firstname Lastname
Firstname Initial Lastname
Firstname Lastname <email>
Initials
Username <email>
Username

It makes it a lot harder. I don't need you to build me a regex I would just like to know:

  1. If bazaar has some command that shows the message (cant find in http://doc.bazaar.canonical.com/bzr.2.5/en/user-reference/index.html)

  2. Should I use regex and use the date as the anchor to parse out message?

1

Take a look at this SO Q&A titled: bzr logs: Get just the commit messages. You can use bzr log --short or write your own custom log formatter via a plugin to bazzar.

You can see more about the log formats using this command:

$ bzr help log-formats

In looking through the effort to make your own formatter through a plugin, I'd be inclined to just use one of the stock ones and run the output through either an awk or Perl filter.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.