summary refs log tree commit diff
path: root/githooks/commit-msg
blob: d241f2b726ab1bc97bc77b690956050be307cc43 (plain)
1
2
3
4
5
6
7
8
9
#! /usr/bin/env bash
set -euo pipefail
change_id=$(head -c32 /dev/urandom | git hash-object --stdin)

git interpret-trailers \
    --if-exists doNothing \
    --trailer "Change-Id:I$change_id" \
    "$1" > "$1.tmp"
mv "$1.tmp" "$1"