KiCad & Git Filters (clean & smudge) for Schematics - "Sheet" text

Git often shows me that many schematics were edited (usually ones which are hierarchical blocks) when I most certainly did not touch those blocks.

For example:
In schematic files, I often have a diff such as…

    diff --git a/power/power_AP2210K_5V_0805.sch b/power/power_AP2210K_5V_0805.sch
    index 3f228ca..48c12f9 100644
    --- a/power/power_AP2210K_5V_0805.sch
    +++ b/power/power_AP2210K_5V_0805.sch
    @@ -4,7 +4,7 @@ EELAYER 26 0
     EELAYER END
     $Descr A4 11693 8268
     encoding utf-8
    -Sheet 22 55
    +Sheet 22 56
     Title ""
     Date ""
     Rev ""

…where the only change is this “Sheet xx xx” line.

What does this sheet line mean?
and can I have git ignore it by adding this to .gitattributes:

*.sch filter=kicad_sch

and these lines? (where I would need some help with sed)

git config --global filter.kicad_project.clean “sed -E ‘s/^Sheet.*$/Sheet/’”
git config --global filter.kicad_project.smudge cat

It’s the sheet number and number of sheets.

You might find the following reference helpful in understanding the use of git smudge & clean operations with KiCad. There is a good explanation of the process.

2 Likes

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