diff options
| author | patrick-scho | 2025-06-03 14:48:23 +0200 |
|---|---|---|
| committer | patrick-scho | 2025-06-03 14:48:23 +0200 |
| commit | b6f6ce350d6080e2b2b7a6420447307fc93f56c4 (patch) | |
| tree | e44b5c5cb354defa32f939705f96512c3d046d73 | |
| parent | 1071cff3ca2626dca967eb0989c0874764c460e2 (diff) | |
| download | git-hooks-b6f6ce350d6080e2b2b7a6420447307fc93f56c4.tar.gz git-hooks-b6f6ce350d6080e2b2b7a6420447307fc93f56c4.zip | |
add comments to git-hooks/post-receive
| -rwxr-xr-x | git-hooks/post-receive | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/git-hooks/post-receive b/git-hooks/post-receive index 8e4c837..2af01a8 100755 --- a/git-hooks/post-receive +++ b/git-hooks/post-receive @@ -11,14 +11,18 @@ def check(args, input=None): REPO = "/srv/git/git-hooks" BRANCH = "main" +# cd into repo os.chdir(REPO) +# list all directories dirs = check(["git", "ls-tree", "--name-only", BRANCH]).splitlines() for d in dirs: + # list all files files = check(["git", "ls-tree", "--name-only", f"{BRANCH}:{d}"]).splitlines() for f in files: + # print the hook and write it to the git repo file = check(["git", "--no-pager", "show", f"{BRANCH}:{d}/{f}"]) with open(f"/srv/git/{d}/hooks/{f}", "w") as fd: fd.write(file) |
