Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Finding Diff files in clear case

by jerrylus (Initiate)
on Aug 15, 2001 at 19:09 UTC ( #105064=perlquestion: print w/ replies, xml ) Need Help??
jerrylus has asked for the wisdom of the Perl Monks concerning the following question:

have a group of files say file1A, file2A to file9A. I have updated these application in clarify and now I have my set of files file1B,file2B,file3B to file9b. So files with B are superset files with A... Now the files with A are constantly updated...I have to see which all files are updated - It is not necessary that all the files are updated at a time.. I have to see what are the changes in filesA and may or may not make the changes in B. This is the scenario... I have to take a 'baseline' difference of file A and B. now this 'diff' file must be compared with the diff file of the latest versions of A and B at present time.. so that is diff of two diff files must be created when I run the application...

Comment on Finding Diff files in clear case
Re: Finding Diff files in clear case
by bikeNomad (Priest) on Aug 15, 2001 at 20:30 UTC
    It's not clear to me what you're doing, but it sounds like you have the classic "diff3" situation, where a single file is changed to become two other files.

    You may want to look at my Algorithm::Diff module. This can produce (among other things) an array of differences that can then be compared for their differences.

    But note that this information contains line numbers, whose position will change as A and B change from the baseline. That is, the original difference may say insert this line after line 5 of file A. However, if you add an identical line to the beginning of both A and B and do the diff again, you will see an output that says to insert this line after line 6 of file A.

    The only way I know to deal with this is to keep a baseline version of the A file, and do diffs with the newest versions of A and B, adjusting line numbers as needed.

Re: Finding Diff files in clear case
by jerrylus (Initiate) on Aug 15, 2001 at 22:39 UTC
    just find the output of the DIFFERENCE between the difference two 'baseline' versions of the file and the difference of the latest versions of the file. this can be done through perl language ?
      Why not? Perl is capable of doing pretty much anything you can describe clearly how to do.

      Do you have a clear-cut method (regardless of language) for doing this? If you can't describe how to do it (regardless of language), you probably can't do it in Perl or any other language.

      I suggest you take a look at Algorithm::Diff, which implements the Hunt/McIlroy diff algorithm (which is used by the Unix diff tool). It may give you a way to get started.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://105064]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (15)
As of 2014-09-19 13:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (138 votes), past polls