Muffinresearch Labs by Stuart Colville

BASH: Open FileMerge from CLI | 2 Comments

Posted in Snippets on 16th August 2007, 1:07 pm by

Here’s a quick tip. If you want to open FileMerge (Apples graphical diff utility available in developer tools) from the CLI you can use the command opendiff e.g: opendiff file1 file2 This save lots of hassle when you are trying to resolve versioning conflicts, as I always find it annoying trying to navigate to the right files from the gui.

Post Tools

  • http://ben-ward.co.uk Ben Ward

    So, whilst this should be an exercise for the reader, what we’d want is an alias to act like this:

    bzrmerge path/to/file.ex

    Automatically open FileMerge and fill in the .THIS, .OTHER and .BASE files for us.

    Must. Learn. Bash.

  • http://muffinresearch.co.uk Stuart Colville

    That would be pretty easy; add to .bashrc:

    function bzrdiff {
    if [ $# -lt 1 ]
    then
    cat <<-END
            Usage: bzrdiff file
            Will automatically compare file.OTHER and file.THIS
    END
    else
      opendiff $1.OTHER $1.THIS -ancestor $1.BASE
    fi
    }

    remember to source ~/.bashrc for changes to take effect.

GNU screen: open tab in current working directory|(1)

A nice trick for having screen open a new tab in the same directory as the one you’re currently in. To use it add it to your .screenrc

# Open new window in current dir.
bind c stuff "screen -X chdir \$PWD;screen^M"
bind ^c stuff "screen -X chdir \$PWD;screen^M"

Hat tip: mteckert on SuperUser.com

Ubuntu: add-apt-repository: command not found|(3)

When you’re using a minimal Ubuntu install if you find the ‘add-apt-repository’ command is missing (it’s useful for adding PPAs and other repositories), then simply run:

sudo apt-get install python-software-properties

Photos on Flickr

© Copyright 2004-12 Stuart Colville, all rights reserved. May contain traces of Muffin. Powered by WordPress. Hosting by Slicehost.com This page was baked in 0.507s.