Commit Graph

8 Commits

Author SHA1 Message Date
Brad Fitzpatrick
647deed2d9 misc: add install-git-hooks.go and git hook for Change-Id tracking
Add misc/install-git-hooks.go and misc/git_hook/ to the OSS repo,
adapted from the corp repo. The primary motivation is Change-Id
generation in commit messages, which provides a persistent identifier
for a change across cherry-picks between branches.

The installer uses "git rev-parse --git-common-dir" instead of go-git
to find the hooks directory, avoiding a new direct dependency while
still supporting worktrees.

Hooks included:
- commit-msg: adds Change-Id trailer
- pre-commit: blocks NOCOMMIT / DO NOT SUBMIT markers
- pre-push: blocks local-directory replace directives in go.mod
- post-checkout: warns when the hook binary is outdated

Also update docs/commit-messages.md to reflect that Change-Id is no
longer optional in the OSS repo.

Updates tailscale/corp#39860

Change-Id: I09066b889118840c0ec6995cc03a9cf464740ffa
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2026-04-08 15:10:53 -07:00
Noel O'Brien
fa22d0a87a docs: add commit message example (#19134)
Fixes #19133

Signed-off-by: Noel O'Brien <noel@tailscale.com>
2026-03-26 10:35:13 -07:00
Harry Harpham
87e108e10c docs: add instructions on referencing pull requests in commit messages
Updates #cleanup
Signed-off-by: Harry Harpham <harry@tailscale.com>
2026-01-12 11:24:23 -07:00
Tom Proctor
eed5e95e27 docs: use -x for cherry-picks
Updates #cleanup

Change-Id: I5222e23b716b342d7c6d113fc539d2021024348e
Signed-off-by: Tom Proctor <tomhjp@users.noreply.github.com>
2025-12-18 09:58:23 +00:00
okunamayanad
5a52f80c4c docs: fix typo in commit-messages.md
Updates: #cleanup

Signed-off-by: okunamayanad <baran@okunamayanad.com>
2025-06-20 06:05:30 -07:00
Simon Law
d303570ab7 docs/commit-messages.md: explain #cleanup commits (#15933)
Adapted from http://go/cleanup.

Fixes: #15932

Signed-off-by: Simon Law <sfllaw@tailscale.com>
2025-05-12 16:23:36 -07:00
Irbe Krumina
624c25bd49 docs/commit-messages.md: merge two 'commit messages' sections (#15668)
Updates#cleanup

Signed-off-by: Irbe Krumina <irbe@tailscale.com>
2025-04-14 15:20:50 +01:00
Brad Fitzpatrick
f5a873aca4 commit-messages.md: make our git commit message style guide public
So we can link open source contributors to it.

Updates #cleanup

Change-Id: I02f612b38db9594f19b3be5d982f58c136120e9a
Co-authored-by: James Sanderson <jsanderson@tailscale.com>
Co-authored-by: Will Norris <will@tailscale.com>
Co-authored-by: James Tucker <james@tailscale.com>
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-04-08 11:41:47 -07:00