gitconfig 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  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[]?, .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)…\") 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 "truncate-dyness-battery-serial-numbers"]
  53. clean = sed -E -e 's/(^|[^[:alnum:]])([Bb][0-9]{6})[0-9]{7}([^[:alnum:]]|$)/\\1\\2…\\3/g'
  54. smudge = cat
  55. required = true
  56. [filter "truncate-mac-address-to-24-bits"]
  57. 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'
  58. smudge = cat
  59. required = true
  60. [diff "yq"]
  61. textconv = yq --yaml-output --indentless-lists . --
  62. [diff "openssl-x509-text"]
  63. textconv = "sh -c 'while openssl x509 -noout -text; do echo; done' <\"$1\" 2>&1"
  64. [diff "pandas-parquet-to-json"]
  65. # g+r for podman container
  66. # https://git.hammerle.me/fphammerle/setup/commit/9c7167b9a9f7e5829d1fba5006b104ab72f6d13a
  67. textconv = "chmod g+r \"$1\" && env --debug -- pandas-parquet-to-json"
  68. [diff "pgpdump"]
  69. textconv = pgpdump
  70. [diff "xzcat"]
  71. textconv = xzcat
  72. [diff "zcat"]
  73. textconv = zcat
  74. [filter "ipynb"]
  75. clean = jq --indent 1 '.cells[].id? = null | (.cells[].outputs[].data[\"application/vnd.jupyter.widget-view+json\"]|objects|select(has(\"model_id\"))).model_id |= null'
  76. [filter "lfs"]
  77. clean = git-lfs clean -- %f
  78. smudge = git-lfs smudge -- %f
  79. process = git-lfs filter-process
  80. required = true
  81. [filter "meshtastic-firmware-config"]
  82. clean = "yq --yaml-output --indentless-lists '.channel_url = \"…\" | .config.bluetooth.fixedPin = \"…\" | .module_config.ambientLighting.blue = \"…\" | .module_config.ambientLighting.green = \"…\" | .module_config.ambientLighting.red = \"…\"' --"
  83. [commit]
  84. gpgsign = true
  85. verbose = true
  86. [rebase]
  87. instructionFormat = %G? %s (%an <%ae>, %ai)
  88. autostash = true
  89. [push]
  90. default = current
  91. [url "git@git.hammerle.me:"]
  92. pushInsteadOf = https://git.hammerle.me/
  93. [url "git@github.com:"]
  94. pushInsteadOf = https://github.com/
  95. [tag]
  96. forceSignAnnotated = true
  97. [log]
  98. date = iso8601-strict
  99. [gcrypt]
  100. participants = 8D2902FE7DF47DDEDA2802F9456B9A0399A5DA2F
  101. publish-participants = false
  102. [annex]
  103. securehashesonly = true
  104. autocommit = false
  105. synccontent = true
  106. # copy instead of hard-linking when unlocking
  107. thin = false
  108. # assistant: do not auto delete unused files
  109. expireunused = false
  110. # fixes sync of repos inside encfs mounts
  111. ssh-options = -S~/.ssh/%r@%n:%p
  112. [alias]
  113. a = add
  114. c = commit
  115. # git curl-github-api /commits/master/statuses | jq '.[].state'
  116. 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"
  117. # git curl-github-ref-status dev | jq '{state, statuses, commit_url}'
  118. curl-github-ref-status = "!f() { ref="$1"; shift; git curl-github-api "/commits/$ref/status" "$@"; }; f"
  119. d = diff
  120. f = fetch --prune
  121. github-repo-names = !git github-urls | grep --only-matching --perl-regexp 'github.com/\\K.+(?=\\.git)'
  122. github-urls = !git remote-urls | grep ^https://github.com/
  123. p = push --verbose
  124. remote-urls = !git remote | xargs -L1 git remote get-url
  125. s = status
  126. t = for-each-ref --sort taggerdate --format '%(taggerdate:iso) %(objectname) %(tag)' refs/tags
  127. 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
  128. x = annex