Search code examples
settingsbazaar

Can bzr ignore empty lines when comparing revisions?


I would like to set up a bzr repository that does not require me to deal with the addition or subtraction of empty lines.

Is it possible to do this?

Are there any potential disadvantages? My code is in R and bash.


Solution

  • When comparing repositories or revisions using bzr diff, you can use diff-options to pass options through to the standard UNIX diff command.

    I've been unable to find a way to handle whitespace changes (tab to spaces, or spaces to tabs) gracefully. I've also been unable to find a way to handle any sort of whitespace changes when performing a merge.

    //show the difference between two revisions, omitting whitespace-only changes.
    cd my_repo
    bzr diff --diff-options='-w' ../my_other_repo
    
    or
    
    //show changes from 451 through 455, omitting whitespace-only changes.
    bzr diff -r450..455 --diff-options='-w'
    
    
    //this is what I use for doing quick code reviews (no whitespace, 15 lines of context)
    bzr diff --diff-options='-w -U 15'