diff options
author | lassulus <lass@blue.r> | 2018-09-09 00:20:15 +0200 |
---|---|---|
committer | lassulus <lass@blue.r> | 2018-09-09 00:20:15 +0200 |
commit | 95b166e4ce9a510c912a11e11c91dbdd2faffad7 (patch) | |
tree | 8e26bf672bb59f5181bea4682b1a6006dd804995 /krebs | |
parent | 69a1de787e5baa2bd6a9b00f585f7b60d4262d1e (diff) | |
parent | 29e5989265bf2f1f8df3dd83706abf791fc63712 (diff) |
Merge remote-tracking branch 'ni/master'
Diffstat (limited to 'krebs')
-rw-r--r-- | krebs/2configs/repo-sync.nix | 10 | ||||
-rw-r--r-- | krebs/5pkgs/simple/git-hooks/default.nix | 15 |
2 files changed, 15 insertions, 10 deletions
diff --git a/krebs/2configs/repo-sync.nix b/krebs/2configs/repo-sync.nix index 813dc154b..3ca94fc1b 100644 --- a/krebs/2configs/repo-sync.nix +++ b/krebs/2configs/repo-sync.nix @@ -20,11 +20,15 @@ let cgit.section = section; hooks = mkDefault { post-receive = pkgs.git-hooks.irc-announce { - nick = config.networking.hostName; - verbose = false; channel = "#xxx"; + refs = [ + "refs/heads/master" + "refs/heads/newest" + "refs/tags/*" + ]; + nick = config.networking.hostName; server = "irc.r"; - branches = [ "master" "newest" ]; + verbose = false; }; }; }; diff --git a/krebs/5pkgs/simple/git-hooks/default.nix b/krebs/5pkgs/simple/git-hooks/default.nix index 1930c7f14..0a2c84410 100644 --- a/krebs/5pkgs/simple/git-hooks/default.nix +++ b/krebs/5pkgs/simple/git-hooks/default.nix @@ -6,11 +6,11 @@ with import <stockholm/lib>; # TODO irc-announce should return a derivation # but it cannot because krebs.git.repos.*.hooks :: attrsOf str irc-announce = - { branches ? [] - , cgit_endpoint ? "http://cgit.${nick}.r" + { cgit_endpoint ? "http://cgit.${nick}.r" , channel , nick , port ? 6667 + , refs ? [] , server , verbose ? false }: /* sh */ '' @@ -57,14 +57,15 @@ with import <stockholm/lib>; receive_mode=non-fast-forward fi - h=$(echo $ref | sed 's:^refs/heads/::') - - ${optionalString (branches != []) '' - if ! (echo "$h" | grep -qE "${concatStringsSep "|" branches}"); then - echo "we are not serving this branch: $h" + ${optionalString (refs != []) '' + if ! { echo "$ref" | grep -qE "${concatStringsSep "|" refs}"; }; then + echo "we are not announcing this ref: $h" exit 0 fi ''} + + h=$(echo $ref | sed 's:^refs/heads/::') + # empty_tree=$(git hash-object -t tree /dev/null) empty_tree=4b825dc6 |