diff options
author | Patrick Jackson <patrick@jackson.dev> | 2024-05-07 22:51:53 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@lix-systems> | 2024-05-07 22:51:53 +0000 |
commit | d184981af019f786df8ddb1b39527df30c62b262 (patch) | |
tree | deb36cb5510521ccec56e77a14e4d6a4b1f37877 /flake.nix | |
parent | 8715a0ac4e5621fe48ddf6d3712c35cc08e347b2 (diff) | |
parent | 9af869436787748ce44ba9ecdf1e6f20aa5b2b83 (diff) |
Merge "feat: setup gerrit commit-msg hook with nix develop" into main
Diffstat (limited to 'flake.nix')
-rw-r--r-- | flake.nix | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -431,6 +431,16 @@ if ! [[ -f .nocontribmsg ]]; then cat ${contribNotice} fi + + # Install the Gerrit commit-msg hook. + # (git common dir is the main .git, including for worktrees) + if gitcommondir=$(git rev-parse --git-common-dir 2>/dev/null) && [[ ! -f "$gitcommondir/hooks/commit-msg" ]]; then + echo 'Installing Gerrit commit-msg hook (adds Change-Id to commit messages)' >&2 + mkdir -p "$gitcommondir/hooks" + curl -s -Lo "$gitcommondir/hooks/commit-msg" https://gerrit.lix.systems/tools/hooks/commit-msg + chmod u+x "$gitcommondir/hooks/commit-msg" + fi + unset gitcommondir ''; } // lib.optionalAttrs (stdenv.buildPlatform.isLinux && pkgs.glibcLocales != null) { |