Skip to content

Feature Request: stable sorting of elements in .kicad_sch files

It would be really nice if the elements in the .kicad_sch files had a defined and stable order.

For one thing it would make the deltas much smaller when schematic files are checked into version control systems like git(hub) and for more advanced users it would allow the use of diff(1) to see what actually has changed.

(The ordering does not have to be particular intuitive or æsthetic, it just have to be the same ordering every time.)

Description

In addition to seemingly random reordering of items in the .kicad_sch files, I also see diff's like this one, flip-flopping between the two values from save to save:

-    (mid 5.0442 -3.2889)
+    (mid 5.0441 -3.2889)

Steps to reproduce

KiCad Version

Application: KiCad

Version: (6.0.0-rc2-14-ga17a58203b), release build

Libraries:
	wxWidgets 3.0.5
	libcurl/7.78.0 OpenSSL/1.1.1l zlib/1.2.11 nghttp2/1.44.0

Platform: FreeBSD 14.0-CURRENT amd64, 64 bit, Little endian, wxGTK, , 

Build Info:
	Date: Dec 20 2021 14:06:27
	wxWidgets: 3.0.5 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
	Boost: 1.72.0
	OCC: 7.5.0
	Curl: 7.78.0
	ngspice: 32
	Compiler: Clang 12.0.1 with C++ ABI 1002

Build settings:
	KICAD_USE_OCC=ON
	KICAD_SPICE=ON