aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Makefile4
-rw-r--r--git_hooks_client/.gitignore1
-rw-r--r--git_hooks_deploy.go8
-rw-r--r--git_hooks_handle.go2
-rw-r--r--hookc/.gitignore1
-rw-r--r--hookc/hookc.c (renamed from git_hooks_client/git_hooks_client.c)0
-rw-r--r--resources.go4
7 files changed, 10 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index 43e344c..55d5ddd 100644
--- a/Makefile
+++ b/Makefile
@@ -5,11 +5,11 @@
CFLAGS = -Wall -Wextra -Werror -pedantic -std=c99 -D_GNU_SOURCE
-forge: $(filter-out forge,$(wildcard *)) version.go git_hooks_client/*.c git_hooks_client/git_hooks_client
+forge: $(filter-out forge,$(wildcard *)) version.go hookc/*.c hookc/hookc
go mod vendor
go build .
-git_hooks_client/git_hooks_client:
+hookc/hookc:
version.go:
printf 'package main\nconst VERSION="%s"\n' $(shell git describe --tags --always --dirty) > $@
diff --git a/git_hooks_client/.gitignore b/git_hooks_client/.gitignore
deleted file mode 100644
index 129c0b4..0000000
--- a/git_hooks_client/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/git_hooks_client
diff --git a/git_hooks_deploy.go b/git_hooks_deploy.go
index b70ccfe..9965b43 100644
--- a/git_hooks_deploy.go
+++ b/git_hooks_deploy.go
@@ -18,12 +18,12 @@ func deploy_hooks_to_filesystem() (err error) {
var src_fd fs.File
var dst_fd *os.File
- if src_fd, err = resources_fs.Open("git_hooks_client/git_hooks_client"); err != nil {
+ if src_fd, err = resources_fs.Open("hookc/hookc"); err != nil {
return err
}
defer src_fd.Close()
- if dst_fd, err = os.OpenFile(filepath.Join(config.Hooks.Execs, "git_hooks_client"), os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0o755); err != nil {
+ if dst_fd, err = os.OpenFile(filepath.Join(config.Hooks.Execs, "hookc"), os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0o755); err != nil {
return err
}
defer dst_fd.Close()
@@ -40,14 +40,14 @@ func deploy_hooks_to_filesystem() (err error) {
// Go's embed filesystems do not store permissions; but in any case,
// they would need to be 0o755:
- if err = os.Chmod(filepath.Join(config.Hooks.Execs, "git_hooks_client"), 0o755); err != nil {
+ if err = os.Chmod(filepath.Join(config.Hooks.Execs, "hookc"), 0o755); err != nil {
return err
}
for _, hook_name := range []string{
"pre-receive",
} {
- if err = os.Symlink(filepath.Join(config.Hooks.Execs, "git_hooks_client"), filepath.Join(config.Hooks.Execs, hook_name)); err != nil {
+ if err = os.Symlink(filepath.Join(config.Hooks.Execs, "hookc"), filepath.Join(config.Hooks.Execs, hook_name)); err != nil {
return err
}
}
diff --git a/git_hooks_handle.go b/git_hooks_handle.go
index 7da6c88..178b3c7 100644
--- a/git_hooks_handle.go
+++ b/git_hooks_handle.go
@@ -28,7 +28,7 @@ var (
err_get_ucred = errors.New("failed getsockopt")
)
-// hooks_handle_connection handles a connection from git_hooks_client via the
+// hooks_handle_connection handles a connection from hookc via the
// unix socket.
func hooks_handle_connection(conn net.Conn) {
var ctx context.Context
diff --git a/hookc/.gitignore b/hookc/.gitignore
new file mode 100644
index 0000000..7348daa
--- /dev/null
+++ b/hookc/.gitignore
@@ -0,0 +1 @@
+/hookc
diff --git a/git_hooks_client/git_hooks_client.c b/hookc/hookc.c
index 9921edf..9921edf 100644
--- a/git_hooks_client/git_hooks_client.c
+++ b/hookc/hookc.c
diff --git a/resources.go b/resources.go
index 63a93af..41d15d7 100644
--- a/resources.go
+++ b/resources.go
@@ -21,7 +21,7 @@ import (
//go:embed *.scfg
//go:embed Makefile
//go:embed static/* templates/* scripts/* sql/*
-//go:embed git_hooks_client/*.c
+//go:embed hookc/*.c
//go:embed vendor/*
var source_fs embed.FS
@@ -30,7 +30,7 @@ var source_handler = http.StripPrefix(
http.FileServer(http.FS(source_fs)),
)
-//go:embed templates/* static/* git_hooks_client/git_hooks_client
+//go:embed templates/* static/* hookc/hookc
var resources_fs embed.FS
var templates *template.Template