~sircmpwn/sr.ht-discuss

1

sr.ht, git.sr.ht and Go imports

Details
Message ID
<D0CVITSETVEK.ZFJ1HHQNC712@sbinet.org>
DKIM signature
pass
Download raw message
hi there,

right now, in Go, to import and use a package hosted on SourceHut, one needs to write:

```go
import "git.sr.ht/~user/repo"
```

this works because the needed metadata information used by the Go tool is present:

```sh
$> curl https://git.sr.ht/~sbinet/peertube |& grep meta
<meta charset="utf-8"/>
<meta content="width=device-width, initial-scale=1" name="viewport"/>
<meta content="git" name="vcs"/>
<meta content="main" name="vcs:default-branch"/>
<meta content="https://git.sr.ht/~sbinet/peertube" name="vcs:clone"/>
<meta content="git@git.sr.ht:~sbinet/peertube" name="vcs:clone"/>
<meta content="https://git.sr.ht/~sbinet/peertube" name="forge:summary"/>
<meta content="https://git.sr.ht/~sbinet/peertube/tree/{ref}/{path}" name="forge:dir"/>
<meta content="https://git.sr.ht/~sbinet/peertube/tree/{ref}/{path}" name="forge:file"/>
<meta content="https://git.sr.ht/~sbinet/peertube/blob/{ref}/{path}" name="forge:rawfile"/>
<meta content="https://git.sr.ht/~sbinet/peertube/tree/{ref}/{path}#L{line}" name="forge:line"/>
<meta content="git.sr.ht/~sbinet/peertube git https://git.sr.ht/~sbinet/peertube" name="go-import"/>
```

couldn't we (optionally?) add the needed bits to the project level page -- when a repository is connected to the project -- ie: the "go-import" and the "go-source" metadata, so 'import "sr.ht/~user/project"' would work as well ?

WDYT ?
would that make sense ?

cheers,
-s
Details
Message ID
<D0CX3IVNKXX1.18MK8U7MMX6XF@cmpwn.com>
In-Reply-To
<D0CVITSETVEK.ZFJ1HHQNC712@sbinet.org> (view parent)
DKIM signature
pass
Download raw message
This is not feasible, because projects can contain more than one git
repository. Even if we added the tags to projects with just one repo, as
soon as you added a second one all of your downstreams would break.
Reply to thread Export thread (mbox)