• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: FileMerge filters/scripts
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FileMerge filters/scripts


  • Subject: Re: FileMerge filters/scripts
  • From: John Daniel <email@hidden>
  • Date: Tue, 20 Feb 2007 12:18:53 -0600

On Feb 20, 2007, at 10:39 AM, Greg Guerin wrote:

John Daniel wrote:

I'll go back to lurking until I can contribute something useful.

Quite a few messages back, you mentioned some scripts you use with
FileMerge. Could you list what they do, or if they're short, post them?


Cameron Hayne already posted an improved line-ending filter, but if you
have any others, I'd like to hear about them.

I have the following "rundiff" script set as my diff tool instead of FileMerge:


#!/bin/sh

# Run opendiff with the proper merge settings.
opendiff $1 $2 -merge $2

This way, I can pick my changes, make edits, and just save it. I don't have to re-navigate to where the file is.

The only other FileMerge script I have is "cvsdiff" to do a CVS compare with the repository version from the command line:

#!/bin/bash

# Delete any old files.
rm -Rf "/tmp/*.cvsdiff"

# Do the diff.
cvs diff ${*} > /tmp/$$.cvsdiff

# Get a hold of the last parameter.
eval LAST=\${$#}

# Copy the file to /tmp, append the process ID, and .cvsdiff to the file name.
cp "$LAST" "/tmp/$LAST.$$.cvsdiff"


# Now patch the temp file to the previous version.
patch -s -R "/tmp/$LAST.$$.cvsdiff" < /tmp/$$.cvsdiff

# Now run opendiff with the previous version and the current version.
opendiff "/tmp/$LAST.$$.cvsdiff" "$LAST" -merge "$LAST"

This script is really ancient. There are probably more efficient ways to do that.

I've never had any line ending issues, so I don't have any scripts to deal with them. I just make sure to save everything with Unix line endings so that CVS and grep will work. The only reason I have to use other line endings is to test how well my software works with them. I have code where CRLF is significant.

I have some bigger scripts to, but I don't use them as often. I've posted them on http://www.etresoft.org

backup, makebackup, mysqlbackup - Time-stamped tarball backups
makexcodetemplate - Converting a project into a project template
rfind - For recursive greps
sloc - For SLOC counts
xcodeclean - For cleaning up an Xcode project prior to importing into CVS


I used to have lots, lots more scripts back when I worked on Solaris. I think I had more than 50 at one point. Many were for specific work- related things. Many were strictly to make software development on Forte not as painful. I don't need either set anymore, but it was very good practice.

John


_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >FileMerge filters/scripts (From: Greg Guerin <email@hidden>)

  • Prev by Date: Re: File bug reports, please (was Re: Desired Feature: Language plugins & documentation)
  • Next by Date: Re: File copying
  • Previous by thread: FileMerge filters/scripts
  • Next by thread: File copying
  • Index(es):
    • Date
    • Thread