gitconfig 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. [user]
  2. name = Fabian Peter Hammerle
  3. email = fabian@hammerle.me
  4. signingkey = 8D2902FE7DF47DDEDA2802F9456B9A0399A5DA2F
  5. [core]
  6. excludesfile = ~/.config/git/gitignore
  7. # hooksPath = ~/.config/git/hooks
  8. [interactive]
  9. singleKey = true
  10. [init]
  11. defaultBranch = main
  12. [status]
  13. branch = true
  14. short = true
  15. showUntrackedFiles = normal
  16. [grep]
  17. lineNumber = true
  18. [diff]
  19. tool = vimdiff
  20. [diff "cat"]
  21. textconv = cat
  22. [diff "csv-to-yaml"]
  23. textconv = csv-to-yaml
  24. [diff "db_dump"]
  25. textconv = db_dump
  26. [diff "gpg-show-keys"]
  27. textconv = gpg --show-keys --with-subkey-fingerprint --with-keygrip --
  28. [diff "gpg-verify"]
  29. textconv = gpg --verify --output=- 2>&1 --
  30. [diff "hexdump"]
  31. textconv = od -t x1z --
  32. [filter "home-assistant-analytics"]
  33. clean = jq '.data.submission_identifier |= if . != null then \"…\" else . end'
  34. smudge = cat
  35. required = true
  36. [filter "home-assistant-auth"]
  37. clean = jq '.data.refresh_tokens |= if . != null then \"…\" else . end'
  38. smudge = cat
  39. required = true
  40. [filter "home-assistant-backup"]
  41. clean = "jq 'reduce ([\"data\", \"backups\"], [\"data\", \"config\", \"last_attempted_automatic_backup\"], [\"data\", \"config\", \"last_completed_automatic_backup\"], [\"data\", \"config\", \"create_backup\", \"password\"]) as $p (.; if getpath($p) != null then setpath($p; \"…\") else . end)'"
  42. smudge = cat
  43. required = true
  44. [filter "home-assistant-config-entries"]
  45. clean = "jq '(.data.entries[].data |= with_entries(if (.key | IN(\"password\", \"access_token\", \"noise_psk\", \"token\", \"webhook_id\")) and .value != null then .value = \"…\" else . end)) | (.data.entries[].unique_id |= if . != null then sub(\"^(?<p>io[.]homeassistant[.]companion[.]android-[[:xdigit:]]{2})[[:xdigit:]]{14}$\"; \"\\(.p)…\") else . end) | ((.data.entries[] | select(.data.app_id == \"io.homeassistant.companion.android\") | .data.device_id) |= if . != null then sub(\"^(?<p>[[:xdigit:]]{2})[[:xdigit:]]{14}$\"; \"\\(.p)…\") else . end) | ((.data.entries[] | select(.domain == \"samsungtv\") | .unique_id) |= if . != null then sub(\"^(?<p>[[:xdigit:]]{2})[[:xdigit:]]{6}(-[[:xdigit:]]{4}){3}-[[:xdigit:]]{12}$\"; \"\\(.p)…\") else . end)' | eval \"$(git config --get filter.truncate-mac-address-to-24-bits.clean)\" | eval \"$(git config --get filter.truncate-dyness-battery-serial-numbers.clean)\""
  46. smudge = cat
  47. required = true
  48. [filter "home-assistant-device-registry"]
  49. required = true
  50. clean = "jq '(.data.devices[] |= if .manufacturer == \"Victron Energy BV\" then (.name, .serial_number) |= if . != null then sub(\"(?<p>HQ[0-9]{4}[[:alnum:]])[[:alnum:]]{4}(?=[^[:alnum:]]|$)\"; \"\\(.p)…\") else . end elif .manufacturer == \"Valetudo\" then .configuration_url |= if . != null then sub(\"(?<p>://valetudo-[[:alnum:]]{2})[[:alnum:]]+\"; \"\\(.p)…\") else . end else . end) | ((.data.devices[] | select(.manufacturer != \"Victron Energy BV\" and .serial_number != null) | .serial_number) |= if length > 6 then .[:6] + \"…\" else . end) | ((.data.devices[]?, .data.deleted_devices[]?) | .identifiers[]? | select(.[1] != null)) |= if .[0] == \"mobile_app\" then .[1] |= sub(\"^(?<p>[[:xdigit:]]{2})[[:xdigit:]]{14}$\"; \"\\(.p)…\") elif .[0] == \"matter\" then .[1] |= (sub(\"^(?<p>deviceid_[[:xdigit:]]{6})[[:xdigit:]]{10}(?=-)\"; \"\\(.p)…\") | sub(\"^(?<p>serial_[[:xdigit:]]{6})[[:xdigit:]]+$\"; \"\\(.p)…\")) elif .[0] == \"samsungtv\" then .[1] |= sub(\"^(?<p>[[:xdigit:]]{2})[[:xdigit:]]{6}(-[[:xdigit:]]{4}){3}-[[:xdigit:]]{12}$\"; \"\\(.p)…\") elif .[0] == \"ftms\" then .[1] |= if length > 6 then .[:6] + \"…\" else . end else . end' | eval \"$(git config --get filter.truncate-mac-address-to-24-bits.clean)\" | eval \"$(git config --get filter.truncate-dyness-battery-serial-numbers.clean)\""
  51. smudge = cat
  52. [filter "home-assistant-entity-registry"]
  53. clean = "jq '((.data.entities[]?, .data.deleted_entities[]?) | select(.unique_id != null)) |= if .platform == \"matter\" then .unique_id |= sub(\"^(?<p>[[:xdigit:]]{6})[[:xdigit:]]{10}(?=-[[:xdigit:]]{16}-)\"; \"\\(.p)…\") elif .platform == \"samsungtv\" then .unique_id |= sub(\"^(?<p>[[:xdigit:]]{2})[[:xdigit:]]{6}(-[[:xdigit:]]{4}){3}-[[:xdigit:]]{12}$\"; \"\\(.p)…\") elif .platform == \"mobile_app\" then (.unique_id |= sub(\"^[[:xdigit:]]{64}(?=_)\"; \"…\")) | if .previous_unique_id != null then .previous_unique_id |= sub(\"^[[:xdigit:]]{64}(?=_)\"; \"…\") else . end elif .platform == \"ftms\" then .unique_id |= sub(\"^(?<p>[[:alnum:]]{6})[[:alnum:]]+(?=-)\"; \"\\(.p)…\") else . end' | eval \"$(git config --get filter.truncate-mac-address-to-24-bits.clean)\""
  54. smudge = cat
  55. required = true
  56. [filter "home-assistant-entity-registry-enabled"]
  57. clean = jq 'del(.data.deleted_entities) | if .data.entities != null then .data.entities |= map(select(.disabled_by == null)) else . end' | eval \"$(git config --get filter.home-assistant-entity-registry.clean)\"
  58. smudge = cat
  59. required = true
  60. [filter "truncate-dyness-battery-serial-numbers"]
  61. clean = sed -E -e 's/(^|[^[:alnum:]])([Bb][0-9]{6})[0-9]{7}([^[:alnum:]]|$)/\\1\\2…\\3/g'
  62. smudge = cat
  63. required = true
  64. [filter "truncate-mac-address-to-24-bits"]
  65. clean = sed -E -e 's/(^|[^[:xdigit:]:])([[:xdigit:]]{2}(:[[:xdigit:]]{2}){2})(:[[:xdigit:]]{2}){3}([^[:xdigit:]:]|$)/\\1\\2:…\\5/g' -e 's/(-[[:xdigit:]]{4}-40e7-(8e6c|9f6c)-[[:xdigit:]]{6})[[:xdigit:]]{6}([^[:xdigit:]]|$)/\\1…\\3/gI' -e 's/(:[[:xdigit:]]{0,4}:[[:xdigit:]]{0,2}ff:fe)[[:xdigit:]]{2}:[[:xdigit:]]{1,4}([^[:xdigit:]:]|$)/\\1…\\2/gI' -e 's/(^|[^[:xdigit:]-])([[:xdigit:]]{6})[[:xdigit:]]{6}([^[:xdigit:]]|$)/\\1\\2…\\3/g'
  66. smudge = cat
  67. required = true
  68. [diff "yq"]
  69. textconv = yq --yaml-output --indentless-lists . --
  70. [diff "openssl-x509-text"]
  71. textconv = "sh -c 'while openssl x509 -noout -text; do echo; done' <\"$1\" 2>&1"
  72. [diff "pandas-parquet-to-json"]
  73. # g+r for podman container
  74. # https://git.hammerle.me/fphammerle/setup/commit/9c7167b9a9f7e5829d1fba5006b104ab72f6d13a
  75. textconv = "chmod g+r \"$1\" && env --debug -- pandas-parquet-to-json"
  76. [diff "pgpdump"]
  77. textconv = pgpdump
  78. [diff "xzcat"]
  79. textconv = xzcat
  80. [diff "zcat"]
  81. textconv = zcat
  82. [filter "ipynb"]
  83. clean = jq --indent 1 '.cells[].id? = null | (.cells[].outputs[].data[\"application/vnd.jupyter.widget-view+json\"]|objects|select(has(\"model_id\"))).model_id |= null'
  84. [filter "lfs"]
  85. clean = git-lfs clean -- %f
  86. smudge = git-lfs smudge -- %f
  87. process = git-lfs filter-process
  88. required = true
  89. [filter "meshtastic-firmware-config"]
  90. clean = "yq --yaml-output --indentless-lists '.channel_url = \"…\" | .config.bluetooth.fixedPin = \"…\" | .module_config.ambientLighting.blue = \"…\" | .module_config.ambientLighting.green = \"…\" | .module_config.ambientLighting.red = \"…\"' --"
  91. [commit]
  92. gpgsign = true
  93. verbose = true
  94. [rebase]
  95. instructionFormat = %G? %s (%an <%ae>, %ai)
  96. autostash = true
  97. [push]
  98. default = current
  99. [url "git@git.hammerle.me:"]
  100. pushInsteadOf = https://git.hammerle.me/
  101. [url "git@github.com:"]
  102. pushInsteadOf = https://github.com/
  103. [tag]
  104. forceSignAnnotated = true
  105. [log]
  106. date = iso8601-strict
  107. [gcrypt]
  108. participants = 8D2902FE7DF47DDEDA2802F9456B9A0399A5DA2F
  109. publish-participants = false
  110. [annex]
  111. securehashesonly = true
  112. autocommit = false
  113. synccontent = true
  114. # copy instead of hard-linking when unlocking
  115. thin = false
  116. # assistant: do not auto delete unused files
  117. expireunused = false
  118. # fixes sync of repos inside encfs mounts
  119. ssh-options = -S~/.ssh/%r@%n:%p
  120. [alias]
  121. a = add
  122. c = commit
  123. # git curl-github-api /commits/master/statuses | jq '.[].state'
  124. curl-github-api = "!f() { path="$1"; shift; git github-repo-names | xargs -I{} --verbose curl --header 'Accept: application/vnd.github.v3+json' 'https://api.github.com/repos/{}'\"$path\" "$@"; }; f"
  125. # git curl-github-ref-status dev | jq '{state, statuses, commit_url}'
  126. curl-github-ref-status = "!f() { ref="$1"; shift; git curl-github-api "/commits/$ref/status" "$@"; }; f"
  127. d = diff
  128. f = fetch --prune
  129. github-repo-names = !git github-urls | grep --only-matching --perl-regexp 'github.com/\\K.+(?=\\.git)'
  130. github-urls = !git remote-urls | grep ^https://github.com/
  131. p = push --verbose
  132. remote-urls = !git remote | xargs -L1 git remote get-url
  133. s = status
  134. t = for-each-ref --sort taggerdate --format '%(taggerdate:iso) %(objectname) %(tag)' refs/tags
  135. tree = log --graph --format=format:'%C(red)%G?%C(reset) %C(yellow)%h%C(reset)%C(blue)%d%C(reset) %C(dim green)%ar%C(reset) %C(white)%s%C(reset) %C(dim cyan)(%an, %ai)%C(reset)' --all
  136. x = annex