rename project to gitforgefs

This commit is contained in:
Massaki Archambault 2024-08-13 22:55:18 -04:00
parent 3ea4cfcbf8
commit 23e78ec886
24 changed files with 36 additions and 42 deletions

View File

@ -1,6 +0,0 @@
FROM alpine
COPY ./bin/gitlabfs /usr/bin/gitlabfs
ENTRYPOINT ["gitlabfs"]

View File

@ -1,4 +1,4 @@
PROGRAM := gitlabfs PROGRAM := gitforgefs
TARGET_DIR := ./bin TARGET_DIR := ./bin
VERSION := $(shell git describe --tags --always) VERSION := $(shell git describe --tags --always)

View File

@ -102,7 +102,7 @@ gitea:
git: git:
# Path to the local repository cache. Repositories in the filesystem will symlink to a folder in this path. # 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: #clone_location:
# The name of the remote in the local clone. # The name of the remote in the local clone.

View File

@ -1,5 +1,5 @@
fs: fs:
mountpoint: /tmp/gitlabfs/test/mnt/gitlab mountpoint: /tmp/gitforgefs/test/mnt/gitlab
mountoptions: nodev mountoptions: nodev
forge: gitlab forge: gitlab
@ -36,7 +36,7 @@ gitea:
include_current_user: true include_current_user: true
git: git:
clone_location: /tmp/gitlabfs/test/cache/gitlab clone_location: /tmp/gitforgefs/test/cache/gitlab
remote: origin remote: origin
on_clone: clone on_clone: clone
auto_pull: false auto_pull: false

View File

@ -83,7 +83,7 @@ func LoadConfig(configPath string) (*Config, error) {
if dataHome == "" { if dataHome == "" {
dataHome = filepath.Join(os.Getenv("HOME"), ".local/share") dataHome = filepath.Join(os.Getenv("HOME"), ".local/share")
} }
defaultCloneLocation := filepath.Join(dataHome, "gitlabfs") defaultCloneLocation := filepath.Join(dataHome, "gitforgefs")
config := &Config{ config := &Config{
FS: FSConfig{ FS: FSConfig{

View File

@ -4,7 +4,7 @@ import (
"reflect" "reflect"
"testing" "testing"
"github.com/badjware/gitlabfs/config" "github.com/badjware/gitforgefs/config"
) )
func TestLoadConfig(t *testing.T) { func TestLoadConfig(t *testing.T) {
@ -16,7 +16,7 @@ func TestLoadConfig(t *testing.T) {
input: "config.test.yaml", input: "config.test.yaml",
expected: &config.Config{ expected: &config.Config{
FS: config.FSConfig{ FS: config.FSConfig{
Mountpoint: "/tmp/gitlabfs/test/mnt/gitlab", Mountpoint: "/tmp/gitforgefs/test/mnt/gitlab",
MountOptions: "nodev", MountOptions: "nodev",
Forge: "gitlab", Forge: "gitlab",
}, },
@ -47,7 +47,7 @@ func TestLoadConfig(t *testing.T) {
IncludeCurrentUser: true, IncludeCurrentUser: true,
}, },
Git: config.GitClientConfig{ Git: config.GitClientConfig{
CloneLocation: "/tmp/gitlabfs/test/cache/gitlab", CloneLocation: "/tmp/gitforgefs/test/cache/gitlab",
Remote: "origin", Remote: "origin",
OnClone: "clone", OnClone: "clone",
AutoPull: false, AutoPull: false,

View File

@ -4,7 +4,7 @@ Wants=network-online.target
After=network-online.target After=network-online.target
[Service] [Service]
ExecStart=%h/go/bin/gitlabfs -config %E/gitlabfs/%i.yaml ExecStart=%h/go/bin/gitforgefs -config %E/gitforgefs/%i.yaml
[Install] [Install]
WantedBy=default.target WantedBy=default.target

View File

@ -6,8 +6,8 @@ import (
"sync" "sync"
"code.gitea.io/sdk/gitea" "code.gitea.io/sdk/gitea"
"github.com/badjware/gitlabfs/config" "github.com/badjware/gitforgefs/config"
"github.com/badjware/gitlabfs/fstree" "github.com/badjware/gitforgefs/fstree"
) )
type giteaClient struct { type giteaClient struct {

View File

@ -5,7 +5,7 @@ import (
"sync" "sync"
"code.gitea.io/sdk/gitea" "code.gitea.io/sdk/gitea"
"github.com/badjware/gitlabfs/fstree" "github.com/badjware/gitforgefs/fstree"
) )
type Organization struct { type Organization struct {

View File

@ -4,7 +4,7 @@ import (
"path" "path"
"code.gitea.io/sdk/gitea" "code.gitea.io/sdk/gitea"
"github.com/badjware/gitlabfs/config" "github.com/badjware/gitforgefs/config"
) )
type Repository struct { type Repository struct {

View File

@ -5,7 +5,7 @@ import (
"sync" "sync"
"code.gitea.io/sdk/gitea" "code.gitea.io/sdk/gitea"
"github.com/badjware/gitlabfs/fstree" "github.com/badjware/gitforgefs/fstree"
) )
type User struct { type User struct {

View File

@ -6,8 +6,8 @@ import (
"log/slog" "log/slog"
"sync" "sync"
"github.com/badjware/gitlabfs/config" "github.com/badjware/gitforgefs/config"
"github.com/badjware/gitlabfs/fstree" "github.com/badjware/gitforgefs/fstree"
"github.com/google/go-github/v63/github" "github.com/google/go-github/v63/github"
) )

View File

@ -5,7 +5,7 @@ import (
"fmt" "fmt"
"sync" "sync"
"github.com/badjware/gitlabfs/fstree" "github.com/badjware/gitforgefs/fstree"
"github.com/google/go-github/v63/github" "github.com/google/go-github/v63/github"
) )

View File

@ -3,7 +3,7 @@ package github
import ( import (
"path" "path"
"github.com/badjware/gitlabfs/config" "github.com/badjware/gitforgefs/config"
"github.com/google/go-github/v63/github" "github.com/google/go-github/v63/github"
) )

View File

@ -5,7 +5,7 @@ import (
"fmt" "fmt"
"sync" "sync"
"github.com/badjware/gitlabfs/fstree" "github.com/badjware/gitforgefs/fstree"
"github.com/google/go-github/v63/github" "github.com/google/go-github/v63/github"
) )

View File

@ -6,8 +6,8 @@ import (
"slices" "slices"
"sync" "sync"
"github.com/badjware/gitlabfs/config" "github.com/badjware/gitforgefs/config"
"github.com/badjware/gitlabfs/fstree" "github.com/badjware/gitforgefs/fstree"
"github.com/xanzy/go-gitlab" "github.com/xanzy/go-gitlab"
) )

View File

@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"sync" "sync"
"github.com/badjware/gitlabfs/fstree" "github.com/badjware/gitforgefs/fstree"
"github.com/xanzy/go-gitlab" "github.com/xanzy/go-gitlab"
) )

View File

@ -3,7 +3,7 @@ package gitlab
import ( import (
"path" "path"
"github.com/badjware/gitlabfs/config" "github.com/badjware/gitforgefs/config"
"github.com/xanzy/go-gitlab" "github.com/xanzy/go-gitlab"
) )

View File

@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"sync" "sync"
"github.com/badjware/gitlabfs/fstree" "github.com/badjware/gitforgefs/fstree"
"github.com/xanzy/go-gitlab" "github.com/xanzy/go-gitlab"
) )

View File

@ -10,9 +10,9 @@ import (
"strconv" "strconv"
"time" "time"
"github.com/badjware/gitlabfs/config" "github.com/badjware/gitforgefs/config"
"github.com/badjware/gitlabfs/fstree" "github.com/badjware/gitforgefs/fstree"
"github.com/badjware/gitlabfs/utils" "github.com/badjware/gitforgefs/utils"
"github.com/vmihailenco/taskq/v3" "github.com/vmihailenco/taskq/v3"
"github.com/vmihailenco/taskq/v3/memqueue" "github.com/vmihailenco/taskq/v3/memqueue"
) )

View File

@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"strconv" "strconv"
"github.com/badjware/gitlabfs/utils" "github.com/badjware/gitforgefs/utils"
) )
func (c *gitClient) clone(url string, defaultBranch string, dst string) error { func (c *gitClient) clone(url string, defaultBranch string, dst string) error {

View File

@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"strconv" "strconv"
"github.com/badjware/gitlabfs/utils" "github.com/badjware/gitforgefs/utils"
) )
func (c *gitClient) pull(repoPath string, defaultBranch string) error { func (c *gitClient) pull(repoPath string, defaultBranch string) error {

2
go.mod
View File

@ -1,4 +1,4 @@
module github.com/badjware/gitlabfs module github.com/badjware/gitforgefs
go 1.21 go 1.21

12
main.go
View File

@ -7,12 +7,12 @@ import (
"os" "os"
"strings" "strings"
"github.com/badjware/gitlabfs/config" "github.com/badjware/gitforgefs/config"
"github.com/badjware/gitlabfs/forges/gitea" "github.com/badjware/gitforgefs/forges/gitea"
"github.com/badjware/gitlabfs/forges/github" "github.com/badjware/gitforgefs/forges/github"
"github.com/badjware/gitlabfs/forges/gitlab" "github.com/badjware/gitforgefs/forges/gitlab"
"github.com/badjware/gitlabfs/fstree" "github.com/badjware/gitforgefs/fstree"
"github.com/badjware/gitlabfs/git" "github.com/badjware/gitforgefs/git"
) )
func main() { func main() {