Browse Source

add filter "home-assistant-analytics"

Home Assistant stores a signed token authenticating analytics snapshot submissions as data.submission_identifier in .storage/core.analytics. Replace it with "…" via jq, if not null.

Requires jq >= 1.7 to keep floats like snapshot_submission_time unchanged. Since smudge is a no-op, a checkout restores "…", and Home Assistant obtains a new token on its next submission.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fabian Peter Hammerle 2 weeks ago
parent
commit
7219fc58fb
1 changed files with 5 additions and 0 deletions
  1. 5 0
      gitconfig

+ 5 - 0
gitconfig

@@ -42,6 +42,11 @@
 [diff "hexdump"]
 	textconv = od -t x1z --
 
+[filter "home-assistant-analytics"]
+	clean = jq '.data.submission_identifier |= if . != null then \"…\" else . end'
+	smudge = cat
+	required = true
+
 [filter "home-assistant-config-entries"]
 	clean = jq '.data.entries[].data |= with_entries(if (.key | IN(\"password\", \"access_token\")) and .value != null then .value = \"…\" else . end)' | eval \"$(git config --get filter.truncate-mac-address-to-24-bits.clean)\"
 	smudge = cat