Skip to content

Instantly share code, notes, and snippets.

@dtjm
Created August 13, 2010 17:34
Show Gist options
  • Select an option

  • Save dtjm/523243 to your computer and use it in GitHub Desktop.

Select an option

Save dtjm/523243 to your computer and use it in GitHub Desktop.

Revisions

  1. dtjm revised this gist Aug 13, 2010. 1 changed file with 21 additions and 8 deletions.
    29 changes: 21 additions & 8 deletions svn-diffwrap.sh
    Original file line number Diff line number Diff line change
    @@ -1,19 +1,32 @@
    #!/bin/sh
    #
    # Put this somewhere like ~/bin
    #
    # Configure your favorite diff program here.
    #DIFF="/Users/username/bin/mvim -d"
    # Put this somewhere like ~/bin and make it executable
    # `chmod +x ~/bin/svn-diffwrap.sh`

    ##################################################
    ### Configure your favorite diff program here. ###
    ##################################################

    # MacVim
    #DIFF="/Users/username/bin/mvim -d"

    # Vim
    #DIFF="/usr/bin/vimdiff"

    # OS X FileMerge
    DIFF="/usr/bin/opendiff"

    # Subversion provides the paths we need as the sixth and seventh
    # parameters.
    ##################################################
    # Subversion provides the paths we need as the ###
    # sixth and seventh parameters. ###
    ##################################################
    LEFT=${6}
    RIGHT=${7}

    # Call the diff command (change the following line to make sense for
    # your merge program).
    ###################################################
    ### Call the diff command (change the following ###
    ### line to make sense for your merge program). ###
    ###################################################
    $DIFF $LEFT $RIGHT

    # Return an errorcode of 0 if no differences were detected, 1 if some were.
  2. dtjm revised this gist Aug 13, 2010. 2 changed files with 4 additions and 6 deletions.
    6 changes: 0 additions & 6 deletions .subversion/config
    Original file line number Diff line number Diff line change
    @@ -1,6 +0,0 @@
    [helpers]
    ### ...
    ### Set diff-cmd to the absolute path of your 'diff' program.
    ### This will override the compile-time default, which is to use
    ### Subversion's internal diff implementation.
    diff-cmd = ~/bin/svn-diffwrap.sh
    4 changes: 4 additions & 0 deletions config
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    ### ~/.subversion/config
    ### Add this line to the [helpers] section

    diff-cmd = ~/bin/svn-diffwrap.sh
  3. dtjm created this gist Aug 13, 2010.
    6 changes: 6 additions & 0 deletions .subversion/config
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    [helpers]
    ### ...
    ### Set diff-cmd to the absolute path of your 'diff' program.
    ### This will override the compile-time default, which is to use
    ### Subversion's internal diff implementation.
    diff-cmd = ~/bin/svn-diffwrap.sh
    20 changes: 20 additions & 0 deletions svn-diffwrap.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    #!/bin/sh
    #
    # Put this somewhere like ~/bin
    #
    # Configure your favorite diff program here.
    #DIFF="/Users/username/bin/mvim -d"
    #DIFF="/usr/bin/vimdiff"
    DIFF="/usr/bin/opendiff"

    # Subversion provides the paths we need as the sixth and seventh
    # parameters.
    LEFT=${6}
    RIGHT=${7}

    # Call the diff command (change the following line to make sense for
    # your merge program).
    $DIFF $LEFT $RIGHT

    # Return an errorcode of 0 if no differences were detected, 1 if some were.
    # Any other errorcode will be treated as fatal.