Ignoring changes to tstamp for the purpose of reducing git diff spam

For those using git as your version control for kicad projects how do you deal with the ever changing tstamp values? I’ve seen people try to hide these tstamp changes from the diff via custom difftools, but what if I just didn’t commit them?

Is there a good summary of what these values are actually used for in the code anywhere? Would it be ok for me to ignore all changes to these values in my git commits or will this inherently mess something up that refers to these values specifically?

For example I have a git diff from just checking off the “Exempt from courtyard requirement” on one footprint. The diff is huge:

diff --git a/kicad/robot/robot.kicad_pcb b/kicad/robot/robot.kicad_pcb
index a9ccc07..b1bb616 100644
--- a/kicad/robot/robot.kicad_pcb
+++ b/kicad/robot/robot.kicad_pcb
@@ -26432,31 +26432,31 @@
     (property "ki_description" "Single-cell battery")
     (property "ki_keywords" "battery cell")
     (path "/aaf20b87-68dc-43c9-a7d3-4ceda8b87424/0bd86b86-b1c3-4ae6-b20b-54681467bcbc")
-    (attr exclude_from_pos_files)
+    (attr exclude_from_pos_files allow_missing_courtyard)
     (fp_text reference "BT2" (at 0.025 16.256) (layer "B.SilkS") hide
         (effects (font (size 1 1) (thickness 0.15)) (justify mirror))
-      (tstamp 0591762e-645b-44a2-9db8-f2b97a416c21)
+      (tstamp 7f566b12-f92e-4caf-89f3-0abcb10035f9)
     )
     (fp_text value "DNP" (at 0.279 0) (layer "B.Fab") hide
         (effects (font (size 1 1) (thickness 0.15)) (justify mirror))
-      (tstamp 07d1089a-abc3-477c-b59f-59168b23ea6a)
+      (tstamp c3c6cca3-dfec-4633-98de-8a8a3718ac72)
     )
     (fp_text user "-" (at 34.29 0) (layer "B.SilkS") hide
         (effects (font (size 1 1) (thickness 0.15)) (justify mirror))
-      (tstamp 7647c952-2bf1-4896-b244-b9f2cabfcf09)
+      (tstamp 84e11be3-a2d5-44db-b282-bea077250b30)
     )
     (fp_text user "+" (at -34.29 0) (layer "B.SilkS") hide
         (effects (font (size 1 1) (thickness 0.15)) (justify mirror))
-      (tstamp c2910a93-785f-46ba-b4ca-476e6481587b)
+      (tstamp aadb420e-b532-4b63-b9d1-e9f62ddd8674)
     )
     (fp_line (start -39.375 -14.375) (end -39.375 14.375)
-      (stroke (width 0.12) (type solid)) (layer "B.Fab") (tstamp b5eca970-a899-4c29-be96-10ff39010cb7))
+      (stroke (width 0.12) (type solid)) (layer "B.Fab") (tstamp 2f24c092-19cd-467d-8675-91493b196cc5))
     (fp_line (start -39.375 -14.375) (end 39.375 -14.375)
-      (stroke (width 0.12) (type solid)) (layer "B.Fab") (tstamp 2345bf1e-c693-4351-b092-d7bf54da5ac2))
+      (stroke (width 0.12) (type solid)) (layer "B.Fab") (tstamp 93642ff8-37c5-449c-aa11-87a85fb312df))
     (fp_line (start -39.375 14.375) (end 39.375 14.375)
-      (stroke (width 0.12) (type solid)) (layer "B.Fab") (tstamp fb87c615-2a60-4bcc-9852-57f5a7b7ccba))
+      (stroke (width 0.12) (type solid)) (layer "B.Fab") (tstamp f48a2c1f-9141-4f74-9d74-7066eae24615))
     (fp_line (start 39.375 -14.375) (end 39.375 14.375)
-      (stroke (width 0.12) (type solid)) (layer "B.Fab") (tstamp 62e24b51-fe70-459e-8785-643d9e181811))
+      (stroke (width 0.12) (type solid)) (layer "B.Fab") (tstamp 9d22bdd2-a414-430d-9872-76f859de381f))
     (model "${KIPRJMOD}/packages3D/Battery_26650.step"
       (offset (xyz -32.5 0 15))
       (scale (xyz 1 1 1))
@@ -27236,26 +27236,28 @@
     (attr through_hole exclude_from_pos_files)
     (fp_text reference "TH1" (at -27.8 0 90) (layer "B.Fab")
         (effects (font (size 0.25 0.25) (thickness 0.0625)) (justify mirror))
-      (tstamp 53056479-becb-4e6b-9de0-2c2ab972ca0a)
+      (tstamp 27425e69-5d18-4d1b-a29b-2539076f9aaf)
     )
     (fp_text value "DNP" (at 0.279 0) (layer "B.Fab") hide
         (effects (font (size 1 1) (thickness 0.1)) (justify mirror))
-      (tstamp c07d0d9d-b175-47dd-b1bb-60031f50d931)
+      (tstamp dedd0f81-e3aa-4c51-aa6a-61fb7a4b7e6d)
     )
+    (fp_rect (start -28.6 1.9) (end -27 -1.9)
+      (stroke (width 0.05) (type default)) (fill none) (layer "B.CrtYd") (tstamp cebea502-765f-4796-ba42-2630db5d8e1f))
     (fp_line (start -39.375 -14.375) (end -39.375 14.375)
-      (stroke (width 0.12) (type solid)) (layer "B.Fab") (tstamp be29690a-39d0-4da3-8b52-8e78f4112b9a))
+      (stroke (width 0.12) (type solid)) (layer "B.Fab") (tstamp 3714553c-0d25-4a6f-b8cc-ab95c11565a6))
     (fp_line (start -39.375 -14.375) (end 39.375 -14.375)
-      (stroke (width 0.12) (type solid)) (layer "B.Fab") (tstamp c31c9665-af10-4fea-b4bc-11704de428a7))
+      (stroke (width 0.12) (type solid)) (layer "B.Fab") (tstamp 5b8d8cc5-2df1-438b-86ac-068c65b2dea5))
     (fp_line (start -39.375 14.375) (end 39.375 14.375)
-      (stroke (width 0.12) (type solid)) (layer "B.Fab") (tstamp e9257aec-1bf6-4a46-b397-4e3ccd93f149))
+      (stroke (width 0.12) (type solid)) (layer "B.Fab") (tstamp 5cf3421c-0bfd-4754-ae2c-3a4ee91b0832))
     (fp_line (start 39.375 -14.375) (end 39.375 14.375)
-      (stroke (width 0.12) (type solid)) (layer "B.Fab") (tstamp 558b7a36-51e6-4873-94bf-c97f0ca56a7a))
+      (stroke (width 0.12) (type solid)) (layer "B.Fab") (tstamp 0192999a-4951-42a9-a5c3-c376d04095d0))
     (fp_rect (start -28.5 1.8) (end -27.1 -1.8)
-      (stroke (width 0.1) (type solid)) (fill none) (layer "B.Fab") (tstamp c7bcb9e7-4584-4d36-a76f-69bd375d30cf))
+      (stroke (width 0.1) (type solid)) (fill none) (layer "B.Fab") (tstamp e8a5668b-f813-49bf-94f7-a6b917e3e356))
     (pad "1" thru_hole circle locked (at -27.805 1.25) (size 1 1) (drill 0.5) (layers "*.Cu" "*.Mask")
-      (net 31 "Net-(U12-REG25)") (pintype "passive") (tstamp e13f1faa-ec7a-4a8e-8760-c98eb0c9dbfd))
+      (net 31 "Net-(U12-REG25)") (pintype "passive") (tstamp 27006dae-480b-40b2-8794-1e2fa6d0cf40))
     (pad "2" thru_hole circle locked (at -27.805 -1.25) (size 1 1) (drill 0.5) (layers "*.Cu" "*.Mask")
-      (net 35 "Net-(U12-TS)") (pintype "passive") (tstamp 453bcc68-6f09-4985-b829-a2a38ed3820c))
+      (net 35 "Net-(U12-TS)") (pintype "passive") (tstamp 8523dc3f-e328-4db8-9f2d-e1bc41216a2a))
     (model "${KIPRJMOD}/packages3D/NXRT15XH103FA1B040.step"
       (offset (xyz -27.8 0 0))
       (scale (xyz 1 1 1))

When in fact the only significant difference is:

-    (attr exclude_from_pos_files)
+    (attr exclude_from_pos_files allow_missing_courtyard)

What if I only add an edited patch of the the diff to my commit, such that I only end up committing this diff:

diff --git a/kicad/robot/robot.kicad_pcb b/kicad/robot/robot.kicad_pcb
index a9ccc07..5404758 100644
--- a/kicad/robot/robot.kicad_pcb
+++ b/kicad/robot/robot.kicad_pcb
@@ -26432,7 +26432,7 @@
     (property "ki_description" "Single-cell battery")
     (property "ki_keywords" "battery cell")
     (path "/aaf20b87-68dc-43c9-a7d3-4ceda8b87424/0bd86b86-b1c3-4ae6-b20b-54681467bcbc")
-    (attr exclude_from_pos_files)
+    (attr exclude_from_pos_files allow_missing_courtyard)
     (fp_text reference "BT2" (at 0.025 16.256) (layer "B.SilkS") hide
         (effects (font (size 1 1) (thickness 0.15)) (justify mirror))
       (tstamp 0591762e-645b-44a2-9db8-f2b97a416c21)

I’m quite surprised to see “tstamp” instead of “UUID”. And I’m also wondering why they are changing in the first place. In a perfect world they get generated once, and then stick with the “part” throughout the projects life.

This may be worthy of an investigation for a bug report.
First check if it is already reported on gitlab. A second step is to figure out what triggers the UUID change, and it would be nice to add that to the bug report.

Putting some time into both investigating and reporting things like this is how users can (but don’t have to) give back to the KiCad project. It is one of the core principles that keeps Open Source software alive.

Which KiCad version?

Did you do an Update footprint from library? That was a once-off change to the footprint and thus tstamp/uuid I think.

No, I don’t think so. The UUID’s are main method in KiCad to match the footprints with the schematic symbols, and they should therefore stay the same even when you update parts from libraries. It’s still the same part, and it still has the same link between schematic symbol and PCB footprint. If the UUID of a part changes, the link between schematic and pcb is broken for that part.

The UUID’s do change if you cut a section from the schematic and then paste it (on for example another hierarchical sheet). KiCad treats this as deleting the old parts and inserting new parts. You have to use the Paste Special function to keep the UUID’s. But also, this is not about parts, but about texts, and PCB layers are mentioned, so I don’t know what topherbuckley did that caused the change.

I changed the said property of one footprint in a board file. Result:

--- -	2023-08-12 11:44:28.343170957 +0300
+++ /work/PCBs/7.0/DRC_footprint_group/DRC_footprint_group.kicad_pcb	2023-08-12 11:44:18.320773486 +0300
@@ -97,7 +97,7 @@
     (at 111.76 66.04)
     (descr "HVQFN, 24 Pin (https://www.nxp.com/docs/en/package-information/SOT616-3.pdf), generated with kicad-footprint-generator ipc_noLead_generator.py")
     (tags "HVQFN NoLead")
-    (attr smd)
+    (attr smd exclude_from_pos_files)
     (fp_text reference "REF**" (at 0 -3.32) (layer "F.SilkS")
         (effects (font (size 1 1) (thickness 0.15)))
       (tstamp 32bf4213-06b0-4e1c-8666-b7897e9031de)

All timestamps unchanged. This is in v7.0.6.

And indeed Updating a footprint (in the PCB Editor, footprint context menu, Update Footprint) changes the timestamps of the footprint’s items.

Application: KiCad x86_64 on x86_64

Version: 7.0.6-7.0.6~ubuntu22.04.1, release build

Libraries:
wxWidgets 3.2.1
FreeType 2.11.1
HarfBuzz 6.0.0
FontConfig 2.13.1
libcurl/7.81.0 OpenSSL/3.0.2 zlib/1.2.11 brotli/1.0.9 zstd/1.4.8 libidn2/2.3.2 libpsl/0.21.0 (+libidn2/2.3.2) libssh/0.9.6/openssl/zlib nghttp2/1.43.0 librtmp/2.3 OpenLDAP/2.5.14

Platform: Ubuntu 22.04.2 LTS, 64 bit, Little endian, wxGTK, ubuntu-xorg, x11

Build Info:
Date: Jul 7 2023 02:32:39
wxWidgets: 3.2.1 (wchar_t,wx containers) GTK+ 3.24
Boost: 1.74.0
OCC: 7.5.2
Curl: 7.88.1
ngspice: 38
Compiler: GCC 11.3.0 with C++ ABI 1016

Build settings:
KICAD_SPICE=ON

I see the difference in what you are saying now, that the minimal change will occur if the change is done to the local symbol on the PCB, but new tstamps generated if you do the update from the library and update the symbol from library. Thanks for pointing that out.

Yep. I also confirm this. Let me detail the steps for future reference:

Minimum diff

  1. Within the PCB Editor click a footprint and go to the edit menu (i.e. press e)
  2. Toggle one of the Fabrication Attributes (e.g. Exempt from courtyard requirement)
  3. Save within the PCB Editor
  4. git diff will show a one line change.

Noisy diff

  1. Within the PCB Editor click a footprint and go to the edit menu (i.e. press e)
  2. Edit Library Footprint
  3. Go to the footprint edit menu (press e without clicking any individual element)
  4. Toggle one of the Fabrication Attributes (e.g. Exempt from courtyard requirement)
  5. Save within the footprint editor
  6. Back in the PCB Editor Update Footprint from Library
  7. Save in PCB Editor
  8. git diff will show a changes to ALL elements of the footprint, not just the courtyard requirement Fabrication Attribute.

Maybe this is expected behavior, but then what is the proper workflow for updating footprints in a PCB? If I do the Minimum Diff way, then I’m going to end up changing things only locally to the PCB and the DRC will complain that the library does not match the footprint (which is a useful check normally to ensure I didn’t change something unintentionally). Would you just make such a change locally and add a exclusion for the DRC?

This is the proper workflow. I would rather ask why do you really need the Minimum Diff way when you update footprints from libraries. After all, you shouldn’t be updating them all the time. When a footprint is ready for continuous use there’s rarely need to update them to boards.

You can of course ask if it would be possible to change KiCad so that the timestamps in the board would be changed only if the footprint item which belongs to an updated footprint actually changes. A developer would be a better person to answer that; if none of them comments you can file an issue to the gitlab issue database to see what they think about it.

Alrighty. I’m glad to know the differences at least. Especially when creating new footprints, there are initially a lot of things I have to correct as I notice them, and these lead to a lot of duplicate work because of this. For example, the DRC and ERC appear to only log the UUID so when I exclude something intentionally, then find a text value on the silkscreen I forgot to make invisible, I update that in the library, then my DRC and ERC exclusions are all now lost. Say I did that for a part I have 100 copies of in the board. Right clicking and excluding those all one at a time is a real time-killer.

I guess the lesson here is to avoid implementing DRC exclusions until the very last to-do on the board.

If you have to add so many manual exclusions, you should probably be using custom rules instead. If you attach an example project we can probably look into it.

One good example is the DNP capacitors. Having the 3d model off generates this “Footprint does not match library” warning. I’m starting to use the custom rules right now for net classes, so I’ll have a look at how I can use these for that purpose. Thanks for the idea!

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