I am looking for a utility to do a compare between 2 files and list out the functions names that have been changed between the 2 files. Is this possible via a script or a report? This way, I can see which functions were modified when I try to apply these same updates to another unrelated file that has the same function names.
Announcement
Collapse
No announcement yet.
Script or report to List of Functions modified
Collapse
X
-
Hello,
Would your function names have been moved around between the files, or in the same relative order. BC3 is capable of comparing two text files and aligning similar lines. You can also define what text is important, such as a grammar to match on Functions as Important, and mark everything else as Unimportant.
We have a video and guide for Importance, here:
http://www.scootersoftware.com/suppo..._unimportantv3
We have a fully functional trial here for testing before purchase is necessary:
http://www.scootersoftware.com/download.php
And a series of additional tutorial videos here:
http://www.scootersoftware.com/moreinfo.php?zz=videos
Let us know if you have any questions.Aaron P Scooter Software
-
I'm not real clear on the reporting aspects. I looked at the videos available, but I'm not sure where to begin.
File A:
Function A12345
some text
Function B12345
some text
File B:
Function A12345
modified text
Function B12345
some text (same as File A)
I want to get a report that shows only Function A12345 was modified. It would be nice to either see the details of what changed in Function A12345 or just the function name itself.
Does the Important Data feature toggle what is on and off in the reports?
Thank you!!
Comment
-
In the above example, the text in Function B would be equal, and the text in Function A would be different. You could use a report that Show Differences + Context to include nearby equal lines (function name).
We do not currently support detecting a section of text as a function, but this is on our wishlist.Aaron P Scooter Software
Comment
-
Hi,
I'm also looking for the ability to show a report with the associated function that contains the difference, along with the differences themselves. Is this capability now available in Beyond Compare 4?
Ideally, I want to be able to call this to generate an output via script to create a report on multiple files being compared
Thanks!
Comment
-
Hello,
The initial request was to find that the function header had changed, and therefore include the entire different and equal text of the function, but not include other equal text from functions with equal headers. BC4 does not support identifying the Header of the function, and works line by line, with optional context around the difference lines.
If you want to report on differences, and expect for differences to also appear within the function, that is our default functionality.
BC4's Text-Report has similar Display Filter settings as the graphical interface. Is there a combination of filtering (Show Differences, Show Context, etc) that shows the lines you wish to generate the report on?
If there are parts of the file that are Unimportant, those can be defined by regular expression and then ignored for the comparison and report generation.
The actual report generation can be done either in the interface from a folder level selecting files, or in the file level if the files are already open, or in scripting. I'd recommend starting in the interface first, which will allow you to test each report type and option combination on your files. Script can then be configured to perform the same steps once you find a combination that works.
If in a Folder Compare, you can either Edit menu or Toolbar -> Expand All, Session menu -> Folder Compare Report, and if selecting HTML output you can Include links to file reports (for a parent folder level report with links). Or from a Folder Compare, you can Expand all, then Edit menu or Toolbar -> Select All Files, Actions menu -> File Compare Report (for a single large report that contains the content of all selected files, configurable by altering the selection with Display Filters or altering the content with the report options dialog). Or if in the Text Compare looking at a specific pair of files, you can use the Session menu -> Text Compare Report to generate the file level report of just that pair of files.Aaron P Scooter Software
Comment
-
Hi Aaron,
Actually, the functions will be the same. For example, suppose I am comparing 2 files where the function name is specified by ending in a colon, and I am comparing File1 with File2.
File 1
import abc
Function1:line1
line2
line3
line4
Function2:line5
line6
line7
line8
File 2
import abc
Function1:line1
abc1
def2
line4
Function2:line5
ghi3
line7
line8
I'm looking for the difference report to be:
File1
Function1:line2
line3
Function2:line6
File 2
Function1:abc1Function2:
def2
ghi3
In this example, I only showed a few lines, but in my practice, it is hundreds of lines below the function, so the context won't extend far enough. In addition, context will show me the lines that are not different, and I am looking to avoid those.
Is there a way I can achieve a report like that?
Thanks for all your help!
Comment
-
Hello,
Ah, I see. Unfortunately, no. BC4 isn't syntax-aware, so the function name is just another line, and the reporting options function on line comparison results with the option for nearby context. It's on our wishlist to detect function names like this to include for headers of differences, but it's not something we currently support.Aaron P Scooter Software
Comment
Comment