The Go language has a tool to fetch content from git repositories, build the result, and install a binary along GOPATH/bin.
Here is an example that works, but installs the binary strappy as "strappy.git", which is a slight misnomer.
$ go get stash.example.com:7990/scm/inf/strappy.git
Of course, I do not want to forbid repository URLs ending in .git, but I would like to make it optional so I could do this
$ go get stash.example.com:7990/scm/inf/strappy
Is this possible in Stash?
Currently if you want to clone a repo in Stash you don't need to specify the .git extension even though the UI gives you the ".git" as the full URL for cloning.
You can have a look at STASH-4744 for reference as some of our devs commented on that.
Let us know if this answers your question.
Atlassian Support - Stash
Thiago, one more question on this subject. The port number in our clone URLs is causing "go get ..." problems. Is it possible to configure Stash to use meta tags as documented here: https://golang.org/cmd/go/#hdr-Remote_import_paths To illustrate, I would use this import in my Go application code import "example.com/scm/inf/strappy" and the meta tag in the HTTP HEAD would map this to http://example.com:7990/scm/inf/strappy.git The endgame for us here is that we have a lot of already-cloned repositories with a port number in them. And Go cannot handle, nor will it anytime soon if ever, the port in the host part of the import path spec. So to use Go effectively with Stash, I have to a) change all the cloned URLs on all developer desktops to a form without the port and change where Stash listens to http clone requests, or b) port forward at the internal load balancer port 80 to port 7990 to remove the user-facing port spec, or c) this meta tag trick. Thanks for listening.
What I understood from your question is that you want to be able to perform Git operations both using the standard port 80 and the 7990 in which the Tomcat is running. Is my understanding correct?
If that's the case, why don't you set up a reverse proxy in front of Stash? We have a documentation to help you with that:
What Mark is alluding to as option c) above is a feature of go get that will perform the mapping based on a meta tag in the fetched repo's HTML HEAD. Is it possible to modify this in stash?
will result in the following request(s):
If that page contains the meta tag
<meta name="go-import" content="example.com/scm/inf/ git https://example.com:7990/scm/inf/strappy">;
the go tool will verify that https://example.com/scm/inf/?go-get=1 contains the same meta tag and then git clone https://example.com:7990/scm/inf/strappy into GOPATH/src/example.com/scm/inf/.
The question is whether meta tags can be returned as part of a repo get? It seems that UI pages in stash can be "decorated": https://developer.atlassian.com/stash/docs/latest/
There are JIRA 2 issues that I have found:
One looks like it is addressed, but meta tag support appears to not be on Atlassian's radar.
Gitlab fixed this a while ago: https://github.com/gitlabhq/gitlabhq/issues/5769
It would be nice if Atlassian could keep up with their competitors. Golang is growing very fast and I hope the last thing Atlassian wants is to be an impediment to their customers.
We are really struggling with wanting to keep our source in Stash.