From 23e78ec8864581b63c330bc05ce8f013dfdb461b Mon Sep 17 00:00:00 2001 From: Massaki Archambault Date: Tue, 13 Aug 2024 22:55:18 -0400 Subject: [PATCH] rename project to gitforgefs --- Dockerfile | 6 ------ Makefile | 2 +- config.example.yaml | 2 +- config/config.test.yaml | 4 ++-- config/loader.go | 2 +- config/loader_test.go | 6 +++--- .../{gitlabfs@.service => gitforgefs@.service} | 2 +- forges/gitea/client.go | 4 ++-- forges/gitea/organization.go | 2 +- forges/gitea/repository.go | 2 +- forges/gitea/user.go | 2 +- forges/github/client.go | 4 ++-- forges/github/organization.go | 2 +- forges/github/repository.go | 2 +- forges/github/user.go | 2 +- forges/gitlab/client.go | 4 ++-- forges/gitlab/group.go | 2 +- forges/gitlab/project.go | 2 +- forges/gitlab/user.go | 2 +- git/client.go | 6 +++--- git/clone.go | 2 +- git/pull.go | 2 +- go.mod | 2 +- main.go | 12 ++++++------ 24 files changed, 36 insertions(+), 42 deletions(-) delete mode 100644 Dockerfile rename contrib/systemd/{gitlabfs@.service => gitforgefs@.service} (63%) diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 32cc1cb..0000000 --- a/Dockerfile +++ /dev/null @@ -1,6 +0,0 @@ -FROM alpine - -COPY ./bin/gitlabfs /usr/bin/gitlabfs - -ENTRYPOINT ["gitlabfs"] - diff --git a/Makefile b/Makefile index ac29b4a..e41dcba 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -PROGRAM := gitlabfs +PROGRAM := gitforgefs TARGET_DIR := ./bin VERSION := $(shell git describe --tags --always) diff --git a/config.example.yaml b/config.example.yaml index 74591a9..1719ec9 100644 --- a/config.example.yaml +++ b/config.example.yaml @@ -102,7 +102,7 @@ gitea: git: # Path to the local repository cache. Repositories in the filesystem will symlink to a folder in this path. - # Default to $XDG_DATA_HOME/gitlabfs, or $HOME/.local/share/gitlabfs if the environment variable $XDG_DATA_HOME is unset. + # Default to $XDG_DATA_HOME/gitforgefs, or $HOME/.local/share/gitforgefs if the environment variable $XDG_DATA_HOME is unset. #clone_location: # The name of the remote in the local clone. diff --git a/config/config.test.yaml b/config/config.test.yaml index fc28230..d74bb68 100644 --- a/config/config.test.yaml +++ b/config/config.test.yaml @@ -1,5 +1,5 @@ fs: - mountpoint: /tmp/gitlabfs/test/mnt/gitlab + mountpoint: /tmp/gitforgefs/test/mnt/gitlab mountoptions: nodev forge: gitlab @@ -36,7 +36,7 @@ gitea: include_current_user: true git: - clone_location: /tmp/gitlabfs/test/cache/gitlab + clone_location: /tmp/gitforgefs/test/cache/gitlab remote: origin on_clone: clone auto_pull: false diff --git a/config/loader.go b/config/loader.go index 442c307..4070aa2 100644 --- a/config/loader.go +++ b/config/loader.go @@ -83,7 +83,7 @@ func LoadConfig(configPath string) (*Config, error) { if dataHome == "" { dataHome = filepath.Join(os.Getenv("HOME"), ".local/share") } - defaultCloneLocation := filepath.Join(dataHome, "gitlabfs") + defaultCloneLocation := filepath.Join(dataHome, "gitforgefs") config := &Config{ FS: FSConfig{ diff --git a/config/loader_test.go b/config/loader_test.go index 421a0db..cee2618 100644 --- a/config/loader_test.go +++ b/config/loader_test.go @@ -4,7 +4,7 @@ import ( "reflect" "testing" - "github.com/badjware/gitlabfs/config" + "github.com/badjware/gitforgefs/config" ) func TestLoadConfig(t *testing.T) { @@ -16,7 +16,7 @@ func TestLoadConfig(t *testing.T) { input: "config.test.yaml", expected: &config.Config{ FS: config.FSConfig{ - Mountpoint: "/tmp/gitlabfs/test/mnt/gitlab", + Mountpoint: "/tmp/gitforgefs/test/mnt/gitlab", MountOptions: "nodev", Forge: "gitlab", }, @@ -47,7 +47,7 @@ func TestLoadConfig(t *testing.T) { IncludeCurrentUser: true, }, Git: config.GitClientConfig{ - CloneLocation: "/tmp/gitlabfs/test/cache/gitlab", + CloneLocation: "/tmp/gitforgefs/test/cache/gitlab", Remote: "origin", OnClone: "clone", AutoPull: false, diff --git a/contrib/systemd/gitlabfs@.service b/contrib/systemd/gitforgefs@.service similarity index 63% rename from contrib/systemd/gitlabfs@.service rename to contrib/systemd/gitforgefs@.service index 6ede4ab..8e9c900 100644 --- a/contrib/systemd/gitlabfs@.service +++ b/contrib/systemd/gitforgefs@.service @@ -4,7 +4,7 @@ Wants=network-online.target After=network-online.target [Service] -ExecStart=%h/go/bin/gitlabfs -config %E/gitlabfs/%i.yaml +ExecStart=%h/go/bin/gitforgefs -config %E/gitforgefs/%i.yaml [Install] WantedBy=default.target \ No newline at end of file diff --git a/forges/gitea/client.go b/forges/gitea/client.go index b158786..d87c932 100644 --- a/forges/gitea/client.go +++ b/forges/gitea/client.go @@ -6,8 +6,8 @@ import ( "sync" "code.gitea.io/sdk/gitea" - "github.com/badjware/gitlabfs/config" - "github.com/badjware/gitlabfs/fstree" + "github.com/badjware/gitforgefs/config" + "github.com/badjware/gitforgefs/fstree" ) type giteaClient struct { diff --git a/forges/gitea/organization.go b/forges/gitea/organization.go index 5b527a0..267a66a 100644 --- a/forges/gitea/organization.go +++ b/forges/gitea/organization.go @@ -5,7 +5,7 @@ import ( "sync" "code.gitea.io/sdk/gitea" - "github.com/badjware/gitlabfs/fstree" + "github.com/badjware/gitforgefs/fstree" ) type Organization struct { diff --git a/forges/gitea/repository.go b/forges/gitea/repository.go index 9ae4529..ec9088c 100644 --- a/forges/gitea/repository.go +++ b/forges/gitea/repository.go @@ -4,7 +4,7 @@ import ( "path" "code.gitea.io/sdk/gitea" - "github.com/badjware/gitlabfs/config" + "github.com/badjware/gitforgefs/config" ) type Repository struct { diff --git a/forges/gitea/user.go b/forges/gitea/user.go index a8079ec..8e41e7e 100644 --- a/forges/gitea/user.go +++ b/forges/gitea/user.go @@ -5,7 +5,7 @@ import ( "sync" "code.gitea.io/sdk/gitea" - "github.com/badjware/gitlabfs/fstree" + "github.com/badjware/gitforgefs/fstree" ) type User struct { diff --git a/forges/github/client.go b/forges/github/client.go index d7cc429..dda37a5 100644 --- a/forges/github/client.go +++ b/forges/github/client.go @@ -6,8 +6,8 @@ import ( "log/slog" "sync" - "github.com/badjware/gitlabfs/config" - "github.com/badjware/gitlabfs/fstree" + "github.com/badjware/gitforgefs/config" + "github.com/badjware/gitforgefs/fstree" "github.com/google/go-github/v63/github" ) diff --git a/forges/github/organization.go b/forges/github/organization.go index a23569a..9d1b7e0 100644 --- a/forges/github/organization.go +++ b/forges/github/organization.go @@ -5,7 +5,7 @@ import ( "fmt" "sync" - "github.com/badjware/gitlabfs/fstree" + "github.com/badjware/gitforgefs/fstree" "github.com/google/go-github/v63/github" ) diff --git a/forges/github/repository.go b/forges/github/repository.go index abbf482..f1e66ba 100644 --- a/forges/github/repository.go +++ b/forges/github/repository.go @@ -3,7 +3,7 @@ package github import ( "path" - "github.com/badjware/gitlabfs/config" + "github.com/badjware/gitforgefs/config" "github.com/google/go-github/v63/github" ) diff --git a/forges/github/user.go b/forges/github/user.go index 55c294a..1d1d644 100644 --- a/forges/github/user.go +++ b/forges/github/user.go @@ -5,7 +5,7 @@ import ( "fmt" "sync" - "github.com/badjware/gitlabfs/fstree" + "github.com/badjware/gitforgefs/fstree" "github.com/google/go-github/v63/github" ) diff --git a/forges/gitlab/client.go b/forges/gitlab/client.go index fd74ea7..70b06ab 100644 --- a/forges/gitlab/client.go +++ b/forges/gitlab/client.go @@ -6,8 +6,8 @@ import ( "slices" "sync" - "github.com/badjware/gitlabfs/config" - "github.com/badjware/gitlabfs/fstree" + "github.com/badjware/gitforgefs/config" + "github.com/badjware/gitforgefs/fstree" "github.com/xanzy/go-gitlab" ) diff --git a/forges/gitlab/group.go b/forges/gitlab/group.go index 75c6334..0cdfb13 100644 --- a/forges/gitlab/group.go +++ b/forges/gitlab/group.go @@ -4,7 +4,7 @@ import ( "fmt" "sync" - "github.com/badjware/gitlabfs/fstree" + "github.com/badjware/gitforgefs/fstree" "github.com/xanzy/go-gitlab" ) diff --git a/forges/gitlab/project.go b/forges/gitlab/project.go index d0abc65..c960d97 100644 --- a/forges/gitlab/project.go +++ b/forges/gitlab/project.go @@ -3,7 +3,7 @@ package gitlab import ( "path" - "github.com/badjware/gitlabfs/config" + "github.com/badjware/gitforgefs/config" "github.com/xanzy/go-gitlab" ) diff --git a/forges/gitlab/user.go b/forges/gitlab/user.go index f20154b..cde05c9 100644 --- a/forges/gitlab/user.go +++ b/forges/gitlab/user.go @@ -4,7 +4,7 @@ import ( "fmt" "sync" - "github.com/badjware/gitlabfs/fstree" + "github.com/badjware/gitforgefs/fstree" "github.com/xanzy/go-gitlab" ) diff --git a/git/client.go b/git/client.go index 8e71739..cf25c08 100644 --- a/git/client.go +++ b/git/client.go @@ -10,9 +10,9 @@ import ( "strconv" "time" - "github.com/badjware/gitlabfs/config" - "github.com/badjware/gitlabfs/fstree" - "github.com/badjware/gitlabfs/utils" + "github.com/badjware/gitforgefs/config" + "github.com/badjware/gitforgefs/fstree" + "github.com/badjware/gitforgefs/utils" "github.com/vmihailenco/taskq/v3" "github.com/vmihailenco/taskq/v3/memqueue" ) diff --git a/git/clone.go b/git/clone.go index eec9c78..bc85ec5 100644 --- a/git/clone.go +++ b/git/clone.go @@ -4,7 +4,7 @@ import ( "fmt" "strconv" - "github.com/badjware/gitlabfs/utils" + "github.com/badjware/gitforgefs/utils" ) func (c *gitClient) clone(url string, defaultBranch string, dst string) error { diff --git a/git/pull.go b/git/pull.go index ed5a448..5de6b83 100644 --- a/git/pull.go +++ b/git/pull.go @@ -4,7 +4,7 @@ import ( "fmt" "strconv" - "github.com/badjware/gitlabfs/utils" + "github.com/badjware/gitforgefs/utils" ) func (c *gitClient) pull(repoPath string, defaultBranch string) error { diff --git a/go.mod b/go.mod index 3743038..36e7fed 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/badjware/gitlabfs +module github.com/badjware/gitforgefs go 1.21 diff --git a/main.go b/main.go index 7445a68..d833972 100644 --- a/main.go +++ b/main.go @@ -7,12 +7,12 @@ import ( "os" "strings" - "github.com/badjware/gitlabfs/config" - "github.com/badjware/gitlabfs/forges/gitea" - "github.com/badjware/gitlabfs/forges/github" - "github.com/badjware/gitlabfs/forges/gitlab" - "github.com/badjware/gitlabfs/fstree" - "github.com/badjware/gitlabfs/git" + "github.com/badjware/gitforgefs/config" + "github.com/badjware/gitforgefs/forges/gitea" + "github.com/badjware/gitforgefs/forges/github" + "github.com/badjware/gitforgefs/forges/gitlab" + "github.com/badjware/gitforgefs/fstree" + "github.com/badjware/gitforgefs/git" ) func main() {