Git friendly line order in kicad_pcb files

In my experience, using git for version control works reasonably well with KiCad (5.1.6) files.

However, very small changes to a board will often cause the kicad_pcb file to be “re-shuffled”, leading to an unnecessarily large diff.

For example, I just got 1 file changed, 195 insertions(+), 191 deletions(-), of which 191 deletions/insertions are just changes in line order.

As a result, it is difficult to check what has actually changed between commits.

For example, a git diff will show things like this, which is the same line moved to another location:

- (fp_circle (center 0 0) (end 2.5 0) (layer F.CrtYd) (width 0.05))
(fp_circle (center 0 0) (end 2.3 0) (layer Cmts.User) (width 0.15))
+ (fp_circle (center 0 0) (end 2.5 0) (layer F.CrtYd) (width 0.05))

I suppose this is the result of some rebuilding operation.

I do realize this may not be trivial to solve, but is there any way it could be improved in future versions?

1 Like

This has probably been fixed in 5.99 (the unstable development version) (see Tools for cooperation?). If not, it should be reported to the issue database.

1 Like

Thanks, that’s exactly what I was looking for. :slight_smile:
Guess I should have done a bit more searching.
I’ll give the development version a try.

Just a friendly warning. Trying out the development version is a one-way path for any projects that you save. You can have both the stable and the development version of the KiCad program suite installed on the same machine (or should be able to, I’m not sure if it works on MacOS since I don’t have any MacOS systems), but there are enough new things in the development version file formats that going back to the stable is difficult (for PCB files) to impossible (for the schematic files which are a completely new file format). Remember, back-ups of your project files are your friends. :wink:

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