Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Jul 1995 18:36:54 -0700 (PDT)
From:      "Rodney W. Grimes" <rgrimes@gndrsh.aac.dev.com>
To:        asami@cs.berkeley.edu (Satoshi Asami)
Cc:        knarf@nasim.cube.net, freebsd-ports@freebsd.org
Subject:   Re: diffs and checksums
Message-ID:  <199507140136.SAA29557@gndrsh.aac.dev.com>
In-Reply-To: <199507140113.SAA25137@forgery.CS.Berkeley.EDU> from "Satoshi Asami" at Jul 13, 95 06:13:12 pm

next in thread | previous in thread | raw e-mail | index | archive | help
...
> Satoshi
> 
> P.S. By the way, is there some way to convert a -u diff to -c or vice
>      versa?  I took a look at man pages of diff and patch, but
>      couldn't find anything....

patch < unidiff; diff -c original new

:-), gross, but what I do when I have one format that does not make
a whole lot of since and want to look at in the other format to see
if that makes more since to me.

Unlike the strongly sided one way or the other folks here I like that
there are both formats, some changes present themselves much clearer
in one format than the other.  I tend to use the one that makes the
patch as obvious as possible.

One bugger in diff -c is that it gets confused some time and produces
junk like

  alah alah alah
! blah blah blah
  clah clah clah
----
  alah alah alah
! blah blah blah
! dlah dlah dlah
! elah elah elah
  clah clah clah

It usually does this when there is a blank line near the change,
which in a lot of C code is a quite common thing :-(.

Now if you want something really horrible to read, try the diff -an
that RCS uses to store deltas, BLEHH!  But, compact!

Perhaps there is the answer to Satoshi's conversion problem, as rcs
actuall stores diff -an, but can produce either diff -c or diff -u,
but I it does this by creating the two versions of the files using
back walking diff -an down the versions, and then does the proper
diff on the 2 tmp files.

Another way to do what I did above using rcs would be:
ci file
co -l file
patch <patchfile
ci file
rcsdiff -u -r1.1 -r1.2 file
or
rcsdiff -c -r1.1 -r1.2 file

This would screw with RCS keywords unless you did a rcsadmin -ko on
the file after the first checkin.


-- 
Rod Grimes                                      rgrimes@gndrsh.aac.dev.com
Accurate Automation Company                 Reliable computers for FreeBSD



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199507140136.SAA29557>