saltwend yarnah debbee

0 views
Skip to first unread message

Sebasten Lizarraga

unread,
Aug 3, 2024, 1:20:59 AM8/3/24
to unchepecho

Merging code can get dicey sometimes. Most of the time everything works just fine, but certain types of files under certain conditions can cause problems. Our team recently ran into an issue while trying to merge multiple branches that touched the same XML file, which'll confuse most version control systems and often requires a human stepping in to manually merge the changes. Of course, if you're lucky you merged first.. everyone else can duke it out lol.

Anyway, I found myself needing to grab a couple versions of the file in question and quickly compare them to see where things went wrong. Usually I'd do that using the UI for the VCS right in the browser, but this particular XML file also happens to be generated by a tool that minifies the XML down to a single line. I have yet to see a VCS that helps much with that.

To show you what I mean, here's a sample MS report file from Anthony Duguid, minified with Josh Johnson's XML Tools extension for VS Code, and then pushed to GitHub. I made a tiny change to the minified report file, but can you see it? It is visible below...

Either create a folder, or open one if you already have some files on disk to compare. Unfortunately, VS Code won't compare two files that are opened in the editor but aren't actually saved somewhere. I just created a temp folder to work out of, and added a couple empty files to it.

If you already have the files to compare, awesome - otherwise, paste the contents of whatever you want to compare into those empty files. If your files are minified, as mine were, the VS Code comparison will be as helpful as GitHub.. in other words, not much. There's probably a VS Code extension to help format nearly any file type though, so format it into something manageable if you need to.

Once you've got the files, just select them both in the "Explorer" pane and then choose "Compare Selected". You'll get a typical side-by-side comparison showing the differences in the files. That's it!

The only complaint I have (devs are nitpicky), besides having to save the files first, is that the red/green color scheme can be misleading. That combo is often used in a VCS (GitHub, Azure DevOps, etc) to denote what was deleted in one file (red) and added in another (green).

But here, we're just comparing two random files for differences, so the color really should be something neutral and either the same on both sides, or at least a couple other colors that don't already have a strong connotation in the development world. My guess is that the code that supports this file comparing is shared with VS Code's support for Git and showing changes in files that you would expect to be red/green.

I am doing more or less same sort of thing but its between the two folder number of files to be compared and then copying the missing files lets say from folder A to folder B. The first part is not a problem to read the content and then compare them but what I am stuck in is that, I want to see while the VI is running that how much data is being copying and how much is remaining my be in percentage on some status bar or may be time or may be out of 55 files 20 files copyied 35 remaining etc. Can you please guide me through this how to do it any idea. It will be great help.

I'm not sure if this is something that could be done at the same time as the comparison is occuring. I'd suggest setting up an event structure such that after the comparison is made, then you know how many files need to be copied and this cues the next event, to copy them over. You could have a buffer or array that extracts those necessary files, then an indicator showing the index of the current position of the file that's being copied over. Let me know if this somewhat makes sense.

I imported File B into File, ran SelDupAll, and then Hide for all the selected objects. That left the unique objects but did not explicitly say which file they were from. However by opening the individual files I was able to determine what had/had not changed in the later version.

I tried using Worksession to compare the files. Due to the nature of the files the differences were not obvious without going through the files layer by layer. Unfortunately SelDup and SelDupAll do not check the objects in the reference files.

the use case is that we have an n-tuple production software. Now, say, we are updating our n-tuple creation software and this effects the n-tuple, obviously. We now want to know, what changes are done to our n-tuple exactly, in order to make sure that we did not introduce a bug somewhere and that we understand our changes properly. Also, often we are changing things that should not really change the n-tuple outputs (optimisations etc.) and we want to make sure that this does not change our n-tuple. Therefore, we want to compare the n-tuple created with our latest n-tuple software to a reference n-tuple.

I have 2 excel files containing sales information and i need to perform a reconciliation to make sure they match 100%. I need a workflow that will compare every row from 1 file against every row from the other file and isolate any row that only appears in 1 of the files. I have each file coming in from a different input and have attached examples of what my data looks like. I also import each file with the full file path so i know where each row of data came from. The bottom 2 rows in example 2 do not appear in example 1. Typically these files will contain hundreds of rows so i need a way to isolate unique rows. Any help is much appreciated.

(shown by the arrow) I joined on every column I wanted to compare (in this case all of them). Any row which is unique to the left file will appear in the left output of the join. Any row which is unique to the right will appear in the right output.

There appears to be a "file compare" function built into CCS4. I have figured out how to compare against a "local history" of my edited file. But I would like to compare against a file external to my project. I can see the selection for comparing with "Other selected files", but I can't figure out how to select another file. I have tried ctl + clicking to do a multi-select, but it doesn't seem to work.

The compare file function can be used to compare files in your workspace. Comparing to an external file is a bit combersom, you need to link the external file into a project and than select both files to compare.

This actually makes no sense. If the file I am trying to compare is in a different project, and it has the same name as the file I would like to compare against, I am prevented from linking it to my current project......so...how can I compare two files with the same name???

The ability to compare files is present in CCSv4.x. What you can't do is compare a file in your workspace with one outside your workspace. I don't see the ability to do that in the latest Eclipse 3.6 either.

One trick that I used to compare files that are not within the workspace is to create a dummy project and link a folder (or file) to the project, than you should be able to select two files to compare with that is in your workspace.

I'm using TFS for source control and the other day I undocked my laptop while running VS. I couldn't connect to the internet and then unfortunately there was an unexpected shutdown. Since then I have not been able to go into pending changes and compare the file to it's previous version. When I do, it crashes Visual Studio.

I can change the user tool in Options > Source Control > Visual Studio Team Foundation Server to use a third party diff checker and it works no problem. However, I've gotten used to Visual Studio's diff checker and would like to continue using it, if only because it doesn't open a separate window to diff in.

I understand there's a tool from Si2 called something like lefdiff as part of the LefDef tools (Si2 is the standards organisation that covers OpenAccess and the LEF/DEF formats and parsers). You'd need to register with Si2 and download from there: www.Si2.org/OpenAccess

Thanks for the feedback, I tried searching in Si2 but still couldn't find a comparison tool between the two LEF files.
I tried using cadence tool to import the LEF file into a library, then from the abstract view created by importing the LEF file, I created the GDS file, but that GDS file only contains shapes (rect, ...) and the blockage is not available.
Do you have any ideas for comparing two LEF files?

There are various mentions of lefdiff and lefdefdiff in the README files, but the Si2 site is very hard to navigate and find anything - I couldn't locate the download. I see you've asked on the Si2 forums - that's probably the best solution.

Other than that, my only thought was to do a LEF import in Virtuoso, and then stream out (to GDS) and do an XOR in a physical verification tool, but that would only check a subset of the info (you'd have to do some work to ensure that blockage info was streamed out to layers) - and this wouldn't check connectivity. So finding this comparison tool in the LEF/DEF standards probably is going to be your best option.

Note: the last bullet means I am fully aware of, and prepared for, collisions. I am aware that two identical hashes does not imply equality, but two different hashes confirms inequality.

My particular application: These are small (a few KB) binary files I have a user upload to an app we host on our network. If it's different than our network copy I want to force them to update our network before they can do things with it. However, I don't want to limit my function to this application, but learn how far it may go with others.

I think you are misunderstanding how a hash works though. It does not read bits and pieces of the file, it processes the whole thing into a small output which is a "signature" of that file. With very, very high probability (if your hash function is good) it is unlikely that two files will create the same hash if they are not, in fact, the same file. But, it is not by itself any faster than comparing piecewise whether two files are equal.

c01484d022
Reply all
Reply to author
Forward
0 new messages