freaking whitespace / cvs diff / patches / die whitespace!

Questions or HOWTOs about the above? Post 'em here...
Post Reply
michaelh20
Private First Class
Private First Class
Posts: 57
Joined: Thu Dec 12, 2002 2:28 am
Location: MN USA

freaking whitespace / cvs diff / patches / die whitespace!

Post by michaelh20 » Tue Apr 08, 2003 9:46 pm

Any suggestions as to how I get the ten thousand little changes that are now in patch that are completely meaningless out of the patch? So I downloaded the source code, did my modifications and inbetween someone edited out a bunch of spaces and reformated a bunch of my old code (heh), hence my patch includes

(1) My actual changes
(2) Puts back in a bunch of spaces and *de* formats the positive format changes from before

I'm using cygwin and I can't seem to find the options in cvs diff and patch to not include whitespace or ignore it, or those options don't seem to be present/work.

I also tried to edit the patch which then killed the patch with a "malformed patch" error.

User avatar
learner
General
General
Posts: 270
Joined: Sun May 11, 2003 2:06 am
Location: Maryland
Contact:

... manually

Post by learner » Mon May 19, 2003 2:38 am

As far as I know, there's not a way to tell <code>cvs</code> to ignore whitespace or newlines. I'd recommend actually creating a real diff set off of the existing cvs and then manually doing the merge.

The <b>diff</b> command itself supports (on most platforms) the capability to ignore whitespace. On my system, it's <b>-b</b> and <b>-B</b> for whitespace and empty lines respectively.

What you'll need to do is the following:

1) move your cvs checkout aside
<code>mv bzflag bzflag.spaced</code>
2) do a new checkout
<code>cvs checkout ...</code>
3) diff the two source trees ignoring whitespace
<code>diff -r -b -B bzflag.spaced bzflag > diff.log</code>
4) merge changes into bzflag by hand

Not too complicated, really. #4 can be a little tedious depending on how many changes, but it's a no-brainer approach. Diff will dump out diff blocks wherever there is a change with line numbers so you can directly merge your new stuff into the tree. It's also convenient just to see a flat log of all of your changes.

You might need diff if you are on windows -- I think gnu.org has a version for wintel.

Cheers!

Post Reply