Random sort order of bus_alias entries when loading (and later saving) leads to pseudo VCS changes
<!-- --------Before Creating a New Issue----------- * Limit report to a single issue. * Search the issue tracker to verify the issue has not already been reported. * Complete all instructions between `template markers <>. * Keep report contents limited to the necessary information required to fix the issue. ---------Add your issue details below----------- --> # Description <!-- What is the current behavior and what is the expected behavior? --> <!-- If the issue is visual/graphical, please attach screenshots of the problem. --> When loading a schematic file with bus_alias definitions, the order of bus alias definitions is random. This can be verified with "Tools -> Bus Definitions..." (order changes after each file load operation). This behavior leads to pseudo-changes when committing saved .kicad_sch files to a VCS (e.g. Git) repo. N.b.: The save order is the same as the listing order under "Tools -> Bus Definitions...". # Steps to reproduce <!-- If there are multiple steps to reproduce it or it is a visual issue, then providing a screen recording as an attachment to this report is recommended. --> <!-- If this issue is specific to a project, please attach the necessary files to this issue. --> 1. Open a .kicad_sch that includes bus_aliases (nine entries in my case) and some hierarchical sub-sheets (don't know if the latter matters) 1. Check the sort order of bus alias definitions under "Tools -> Bus Definitions..." 1. Save the unchanged schematic file 1. Close the schematic editor 1. See changed sort order of bus_alias entries in the .kicad_sch file (leads to VCS changes) 1. Repeat the above steps as often as you want - the sort order after loading will change randomly # Suggestion I would suggest to alphabetically sort bus_alias definitions upon file loading and after each modification (e.g. after editing via the Bus Definitions dialog). This would lead to no regression, as the bus_alias order does not seem to matter anyway. # KiCad Version ``` Application: KiCad Version: 6.0.6-3a73a75311~116~ubuntu20.04.1, release build Libraries: wxWidgets 3.0.4 Platform: Linux 5.4.0-120-generic x86_64, 64 bit, Little endian, wxGTK, xfce, x11 wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24 Boost: 1.71.0 OCC: 7.5.2 Curl: 7.83.1 ngspice: 36 Compiler: GCC 9.4.0 with C++ ABI 1013 Build settings: KICAD_USE_OCC=ON KICAD_SPICE=ON ```
issue