~bigbes/sr-ht-compare

a4853d05281d40832e011b6f03a558c7555b997d — Eugene Blikh 30 days ago c1ae0fc
rename module to sourcecraft.dev/bigbes/sr-ht-compare; depend on sourcecraft sr-ht-core
M README.md => README.md +3 -3
@@ 54,7 54,7 @@ fork carries one production S3 patch on top of upstream.

## Build requirements

- **Go** 1.26+ (module `go.bigb.es/sourcehut-compare`).
- **Go** 1.26+ (module `sourcecraft.dev/bigbes/sr-ht-compare`).
- **sassc** and **minify** — CSS pipeline (`make css`), building against the
  shared sourcehut scss partials installed at `/usr/share/sourcehut/scss` (from
  `core.sr.ht`'s `make install`). `dart-sass` also works for local builds; the


@@ 178,8 178,8 @@ import (
    "encoding/json"
    "fmt"

    "git.sr.ht/~sircmpwn/core-go/config"
    "git.sr.ht/~sircmpwn/core-go/crypto"
    "sourcecraft.dev/bigbes/sr-ht-core/config"
    "sourcecraft.dev/bigbes/sr-ht-core/crypto"
)

func main() {

M authz/authz.go => authz/authz.go +2 -2
@@ 7,9 7,9 @@ import (
	"sync"
	"time"

	"git.sr.ht/~sircmpwn/core-go/client"
	"sourcecraft.dev/bigbes/sr-ht-core/client"

	"go.bigb.es/sourcehut-compare/core"
	"sourcecraft.dev/bigbes/sr-ht-compare/core"
)

// RepoInfo is the subset of git.sr.ht repository metadata compare.sr.ht needs

M authz/authz_test.go => authz/authz_test.go +3 -3
@@ 11,11 11,11 @@ import (
	"testing"
	"time"

	"git.sr.ht/~sircmpwn/core-go/config"
	"git.sr.ht/~sircmpwn/core-go/crypto"
	"sourcecraft.dev/bigbes/sr-ht-core/config"
	"sourcecraft.dev/bigbes/sr-ht-core/crypto"
	"github.com/vaughan0/go-ini"

	"go.bigb.es/sourcehut-compare/core"
	"sourcecraft.dev/bigbes/sr-ht-compare/core"
)

// authNameFromRequest asserts the incoming request bears an "Internal <token>"

M authz/identity.go => authz/identity.go +1 -1
@@ 6,7 6,7 @@ import (
	"net/http"
	"strings"

	"git.sr.ht/~sircmpwn/core-go/crypto"
	"sourcecraft.dev/bigbes/sr-ht-core/crypto"
)

// CookieName is the SourceHut unified-login session cookie. Its value is a

M authz/identity_test.go => authz/identity_test.go +1 -1
@@ 9,7 9,7 @@ import (
	"os"
	"testing"

	"git.sr.ht/~sircmpwn/core-go/crypto"
	"sourcecraft.dev/bigbes/sr-ht-core/crypto"
	"github.com/fernet/fernet-go"
	"github.com/vaughan0/go-ini"
)

M cmd/comparesrht/main.go => cmd/comparesrht/main.go +4 -4
@@ 30,15 30,15 @@ import (
	"strings"
	"time"

	"git.sr.ht/~sircmpwn/core-go/config"
	coreserver "git.sr.ht/~sircmpwn/core-go/server"
	"sourcecraft.dev/bigbes/sr-ht-core/config"
	coreserver "sourcecraft.dev/bigbes/sr-ht-core/server"
	"github.com/go-chi/chi/v5"
	"github.com/go-chi/chi/v5/middleware"
	"github.com/sirupsen/logrus"
	"github.com/vaughan0/go-ini"

	"go.bigb.es/sourcehut-compare/authz"
	"go.bigb.es/sourcehut-compare/web"
	"sourcecraft.dev/bigbes/sr-ht-compare/authz"
	"sourcecraft.dev/bigbes/sr-ht-compare/web"
)

const (

M gitx/diff.go => gitx/diff.go +1 -1
@@ 7,7 7,7 @@ import (
	"github.com/go-git/go-git/v5/plumbing/format/diff"
	"github.com/go-git/go-git/v5/plumbing/object"

	"go.bigb.es/sourcehut-compare/core"
	"sourcecraft.dev/bigbes/sr-ht-compare/core"
)

// Patch is a rendered unified diff. Truncated is set when the generated text

M gitx/fidelity_test.go => gitx/fidelity_test.go +1 -1
@@ 7,7 7,7 @@ import (
	"strings"
	"testing"

	"go.bigb.es/sourcehut-compare/core"
	"sourcecraft.dev/bigbes/sr-ht-compare/core"
)

// newFidelityRepo builds a two-commit bare repo whose base..head diff exercises

M gitx/gitx.go => gitx/gitx.go +1 -1
@@ 18,7 18,7 @@ import (
	"github.com/go-git/go-git/v5"
	"github.com/go-git/go-git/v5/plumbing/object"

	"go.bigb.es/sourcehut-compare/core"
	"sourcecraft.dev/bigbes/sr-ht-compare/core"
)

const (

M gitx/gitx_test.go => gitx/gitx_test.go +1 -1
@@ 6,7 6,7 @@ import (
	"strings"
	"testing"

	"go.bigb.es/sourcehut-compare/core"
	"sourcecraft.dev/bigbes/sr-ht-compare/core"
)

func ctx() context.Context { return context.Background() }

M gitx/log.go => gitx/log.go +1 -1
@@ 9,7 9,7 @@ import (
	"github.com/go-git/go-git/v5/plumbing/object"
	"github.com/go-git/go-git/v5/plumbing/storer"

	"go.bigb.es/sourcehut-compare/core"
	"sourcecraft.dev/bigbes/sr-ht-compare/core"
)

// CommitInfo is the metadata of a single commit.

M go.mod => go.mod +2 -4
@@ 1,14 1,14 @@
module go.bigb.es/sourcehut-compare
module sourcecraft.dev/bigbes/sr-ht-compare

go 1.26.4

require (
	git.sr.ht/~sircmpwn/core-go v0.0.0-20260718172441-c2c2f3848fa9
	github.com/fernet/fernet-go v0.0.0-20211208181803-9f70042a33ee
	github.com/go-chi/chi/v5 v5.3.1
	github.com/go-git/go-git/v5 v5.19.1
	github.com/sirupsen/logrus v1.9.4
	github.com/vaughan0/go-ini v0.0.0-20130923145212-a98ad7ee00ec
	sourcecraft.dev/bigbes/sr-ht-core v0.0.0-20260718185800-dd418a200152
)

require (


@@ 64,5 64,3 @@ require (
	google.golang.org/protobuf v1.33.0 // indirect
	gopkg.in/warnings.v0 v0.1.2 // indirect
)

replace git.sr.ht/~sircmpwn/core-go => git.srht.bigb.es/~bigbes/core-go v0.0.0-20260718172441-c2c2f3848fa9

M go.sum => go.sum +2 -2
@@ 7,8 7,6 @@ git.sr.ht/~sircmpwn/getopt v1.0.0 h1:/pRHjO6/OCbBF4puqD98n6xtPEgE//oq5U8NXjP7ROc
git.sr.ht/~sircmpwn/getopt v1.0.0/go.mod h1:wMEGFFFNuPos7vHmWXfszqImLppbc0wEhh6JBfJIUgw=
git.sr.ht/~sircmpwn/go-bare v0.0.0-20210406120253-ab86bc2846d9 h1:Ahny8Ud1LjVMMAlt8utUFKhhxJtwBAualvsbc/Sk7cE=
git.sr.ht/~sircmpwn/go-bare v0.0.0-20210406120253-ab86bc2846d9/go.mod h1:BVJwbDfVjCjoFiKrhkei6NdGcZYpkDkdyCdg1ukytRA=
git.srht.bigb.es/~bigbes/core-go v0.0.0-20260718172441-c2c2f3848fa9 h1:S/CncMS83NIBz+V5OlZEHlnrl1Yd5I4C7hDQ7lzQsTM=
git.srht.bigb.es/~bigbes/core-go v0.0.0-20260718172441-c2c2f3848fa9/go.mod h1:JmathMemB+hBk1IgrMn6RuBGusd+fTg1s/X6rNVKXXU=
github.com/99designs/gqlgen v0.17.36 h1:u/o/rv2SZ9s5280dyUOOrkpIIkr/7kITMXYD3rkJ9go=
github.com/99designs/gqlgen v0.17.36/go.mod h1:6RdyY8puhCoWAQVr2qzF2OMVfudQzc8ACxzpzluoQm4=
github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60=


@@ 322,3 320,5 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
sourcecraft.dev/bigbes/sr-ht-core v0.0.0-20260718185800-dd418a200152 h1:9kQC+tDO2CO8avlKadb9Z0if4a6vJuEK80+4zcb6/fU=
sourcecraft.dev/bigbes/sr-ht-core v0.0.0-20260718185800-dd418a200152/go.mod h1:Mu1Vx39ws/OTKWGoVERXvkdRSPLBdhuFTYv0ftVV31c=

M web/chrome.go => web/chrome.go +2 -2
@@ 6,10 6,10 @@ import (
	"sort"
	"strings"

	"git.sr.ht/~sircmpwn/core-go/config"
	"sourcecraft.dev/bigbes/sr-ht-core/config"
	"github.com/vaughan0/go-ini"

	"go.bigb.es/sourcehut-compare/authz"
	"sourcecraft.dev/bigbes/sr-ht-compare/authz"
)

// navCanonical is the SourceHut service-switcher order. Services not listed here

M web/handlers.go => web/handlers.go +3 -3
@@ 12,9 12,9 @@ import (
	"github.com/go-chi/chi/v5"
	"github.com/sirupsen/logrus"

	"go.bigb.es/sourcehut-compare/authz"
	"go.bigb.es/sourcehut-compare/core"
	"go.bigb.es/sourcehut-compare/gitx"
	"sourcecraft.dev/bigbes/sr-ht-compare/authz"
	"sourcecraft.dev/bigbes/sr-ht-compare/core"
	"sourcecraft.dev/bigbes/sr-ht-compare/gitx"
)

// recentCommitLimit bounds the first-parent history shown on the repo page.

M web/server.go => web/server.go +2 -2
@@ 34,10 34,10 @@ import (
	"path"
	"regexp"

	"git.sr.ht/~sircmpwn/core-go/config"
	"sourcecraft.dev/bigbes/sr-ht-core/config"
	"github.com/vaughan0/go-ini"

	"go.bigb.es/sourcehut-compare/authz"
	"sourcecraft.dev/bigbes/sr-ht-compare/authz"
)

// hashedCSSRe matches the content-addressed stylesheet name so it can be served

M web/web_test.go => web/web_test.go +5 -5
@@ 14,15 14,15 @@ import (
	"strings"
	"testing"

	"git.sr.ht/~sircmpwn/core-go/config"
	"git.sr.ht/~sircmpwn/core-go/crypto"
	"sourcecraft.dev/bigbes/sr-ht-core/config"
	"sourcecraft.dev/bigbes/sr-ht-core/crypto"
	"github.com/fernet/fernet-go"
	"github.com/go-chi/chi/v5"
	"github.com/vaughan0/go-ini"

	"go.bigb.es/sourcehut-compare/authz"
	"go.bigb.es/sourcehut-compare/core"
	"go.bigb.es/sourcehut-compare/gitx"
	"sourcecraft.dev/bigbes/sr-ht-compare/authz"
	"sourcecraft.dev/bigbes/sr-ht-compare/core"
	"sourcecraft.dev/bigbes/sr-ht-compare/gitx"
)

// testConf carries the crypto keys established in TestMain so tests can seal