Search code examples
gitbazaarblame

Bzr Blame Statistics


I want to get a list of the committers and the number of lines they've contributed, eg, the same as Git: Blame Statistics except for a Bzr branch instead of a Git branch.


Solution

  • bzr ls --versioned --recursive --kind file --null \
        | xargs --null --max-args 1 bzr blame --long --all \
        | awk '{ print $2 }' | sort | uniq --count | sort --numeric-sort --reverse
    

    And note that bzr blame by default only works with the most recent revision. If you're trying to do this on an older revision, you need to add --revision=x to make bzr blame output the correct results.

    Also note that bzr is absurdly slow at this and if your repo is large, it's probably worth it to convert it to git and use the git solution before attempting this.