A better difftool for KiCad

Just wanted to share a script I’ve been using to get cleaner git diffs for KiCad PCBs:

https://cdwilson.dev/articles/a-better-difftool-for-kicad/

Let me know if you know of other tools that allow you to see changes between different revisions of files in git.

2 Likes

Thanks for sharing. There are some other tools that allow you to see changes between different revisions of files in git. For example-GitKraken, SourceTree etc.

Using Advanced Usage on ksdiff:

#!/bin/bash
tstamp() { sed -E 's/([(]tstamp\b)[^)]*/\1 -/g' "$@"; }
ksdiff <(tstamp "$1") <(tstamp "$2")

There is KiRI which allows for graphical rather than textural comparisons. The new KiCad-cli should help streamline this approach. KiRI supports git as well as fossil and svn. This sort of textural massaging is very helpful and could help to improve the textural diff component of kidiff.

2 Likes

@mgyger thanks, I had not seen that page!

BTW, I tried your changes and for some reason the \b was causing the match to fail (I don’t really understand why, I think it should work?) As you can probably tell, I’m not a SW engineer… :rofl:

Here’s a slightly tweaked version that ended up working for me (I updated the blog post to use this instead):

tstamp() {
  sed -E 's/([(]tstamp )[^)]*/\1-/g' "$@";
}

ksdiff <(tstamp "$1") <(tstamp "$2")

Thanks for the pointer John, I’ll check out KiRI

Well, too much Perl, I guess (got spoiled on MSYS2)… :wink:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.