Git with Eagle: Add meaning to Diff

a-glimpse-of-git-with-eagleWe love Git. We know everyone has their favorite version tracking tools. But even those that don’t care for Git should see the value of getting meaningful Diff data from tracking Eagle layout files.

Was that last sentence just gibberish to you? Let’s take a step back. A few years ago it was impossible to use version control with Eagle at all because the schematic and PCB layout software used to save its files as binaries. But then Cadsoft transitioned to saving Eagle files as XML. This opened the door for things like scripting to rename parts en masse and to track the files under version control. One problem with the latter has been that performing a Diff on two different versions of a file results in XML changes that are probably not human readable. [Patrick Franken] wrote this script to add at least a glimmer of meaning.

We’d love to see some kind of side-by-side highlighting on the schematic or board renderings themselves. But that’s quite a ways off if we ever actually see it. For now his script will take the Diff and print out the tables seen above denoting which types of changes were made from one version to the next. It’s a start, and we hope it inspires even more work in this area.

10 thoughts on “Git with Eagle: Add meaning to Diff

  1. Saving Eagle files in a character-based, non-proprietary format is indeed a huge step forward. One nit to pick, however, version control software has been able to deal with binary files for over a decade. Git manages binary files. So the fact that Eagle files were binary, did not preclude putting Eagle files into VC. The binary format did, for the most part, preclude the types of manipulation and analysis that you highlight in the article. Didn’t want people unfamiliar with VC to read the post and walk aways thinking that binary files were off limits for VC…

  2. Why not create a converter that maps the unfriendly xml format to and from the usual (pre-xml) simple text format? Depending on how netlists are written (part-oriented, net-oriented, or pin-oriented) simple text diffs can be easy to read. In my opinion, a well documented simple text format is easier to parse and work with than xml. Of course the difftool mentioned above still makes a useful summary that plain diff wouldn’t.

    1. This is what Geagle actually makes. It gets all interesting data from the drawing and saves it separately. The main disadvantage of just doing a text diff on this is that If you for example move a whole group of parts you’ll see a lot of changes. But you are probably not interested in it because from a electrical point of view it doesn’t matter. And it will drown the interesting changes.

    2. You can export netlist, pinlist, partlist etc using the EXPORT command
      in Eagle CAD console. That should help you with a text based diff.

      IMHO XML is a machine parsable format and horrible for human readability
      without a good viewer/editor that presents the data structures.

      It looks like a bad case of alphabet soup core dump.

  3. cool! i will definitely look into using this on my next oshw project. does anything similar exist for 3d models? is that even possible?

    1. openscad and stl are already text files. Not sure about freecad.

      in another domain, beware of ProjectLibre. The default file format is a raw java serialization dump and I recently lost a planning file because of a bad net connection. There is an option to save as xml, I should have used that from the beginning.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s