• We collect Bitbucket feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

      Hello currently we are developing Go and using Stash to hold our source code.
      Currently the 'go get' command doesn't work quite well with stash.

      if i do 'go get' i get the following:
      stash/organization/myproj.git/
      as the directoy structure
      currently there are some implementations that the .git won't get appended.

      > http://golang.org/cmd/go/#hdr-Remote_import_paths

      it would be great if this is possible at all.

            [BSERV-5380] Add support for go get

            Yes, thank you, the "/scm" is the issue. "go get" is working without it.

            Steve Hellwege added a comment - Yes, thank you, the "/scm" is the issue. "go get" is working without it.

            Stefan added a comment - - edited

            steve.hellwege1824777912 - when utilising go get via the meta tag provided by Bitbucket Server, you should not include /scm in your import path. I have edited my previous comment regarding the usage of go get in Bitbucket Server (formally Stash) to include this.

            For your example, the following import path should work:

            go get -insecure stash.wdmv.wdc.com/midy/otaclient/cloud
            

            Stefan added a comment - - edited steve.hellwege1824777912 - when utilising go get via the meta tag provided by Bitbucket Server, you should not include /scm in your import path. I have edited my previous comment regarding the usage of go get in Bitbucket Server (formally Stash) to include this. For your example, the following import path should work: go get -insecure stash.wdmv.wdc.com/midy/otaclient/cloud

            Steve Hellwege added a comment - - edited

            We are using bitbucket 4.1.0. It looks like this is still a problem. How can this be fixed/worked around? This is causing significant problems with our golang development.

            FAILING -->
            steveh@steveh-VirtualBox:/files/middleware-yocto/src/test$ go get -insecure stash.wdmv.wdc.com/scm/midy/otaclient/cloud
            package stash.wdmv.wdc.com/scm/midy/otaclient/cloud: /files/middleware-yocto/src/stash.wdmv.wdc.com/scm/midy exists but /files/middleware-yocto/src/stash.wdmv.wdc.com/scm/midy/.git does not - stale checkout?

            WORKING (if .git is added to repo) -->
            steveh@steveh-VirtualBox:/files/middleware-yocto/src/test$ go get -insecure stash.wdmv.wdc.com/scm/midy/otaclient.git/cloud

            Steve Hellwege added a comment - - edited We are using bitbucket 4.1.0. It looks like this is still a problem. How can this be fixed/worked around? This is causing significant problems with our golang development. FAILING --> steveh@steveh-VirtualBox:/files/middleware-yocto/src/test$ go get -insecure stash.wdmv.wdc.com/scm/midy/otaclient/cloud package stash.wdmv.wdc.com/scm/midy/otaclient/cloud: /files/middleware-yocto/src/stash.wdmv.wdc.com/scm/midy exists but /files/middleware-yocto/src/stash.wdmv.wdc.com/scm/midy/.git does not - stale checkout? WORKING (if .git is added to repo) --> steveh@steveh-VirtualBox:/files/middleware-yocto/src/test$ go get -insecure stash.wdmv.wdc.com/scm/midy/otaclient.git/cloud

            Stefan added a comment - - edited

            From Stash 3.8.0 onwards, you will be able to use go get without specifying a VCS suffix. This will work with both public and private repositories.

            go get {hostname}/{project_key}/{repo_slug}
            

            Note that this is similar to the clone URL of the repository, but without /scm.

            Private repositories will require a username and password to clone. This is a limitation of go get, which doesn't currently support cloning repositories over SSH when a VCS suffix is not specified.

            Stefan added a comment - - edited From Stash 3.8.0 onwards, you will be able to use go get without specifying a VCS suffix. This will work with both public and private repositories. go get {hostname}/{project_key}/{repo_slug} Note that this is similar to the clone URL of the repository, but without /scm . Private repositories will require a username and password to clone. This is a limitation of go get, which doesn't currently support cloning repositories over SSH when a VCS suffix is not specified.

            We're looking into this. The meta tag part is straightforward, we are now looking at how auth factors in.

            Roger Barnes (Inactive) added a comment - We're looking into this. The meta tag part is straightforward, we are now looking at how auth factors in.

            ChristianS added a comment -

            yeah but github enterprise, costs twice as much as stash.

            ChristianS added a comment - yeah but github enterprise, costs twice as much as stash.

            As this is a meta tag, I don't understand why this cannot be implemented easily. I wish someone from engineering would respond to this. Github enterprise is looking more promising.

            Austin Riendeau added a comment - As this is a meta tag, I don't understand why this cannot be implemented easily. I wish someone from engineering would respond to this. Github enterprise is looking more promising.

            Peter Dalinis added a comment - gitlab fixed this a while ago: https://github.com/gitlabhq/gitlabhq/issues/5769 There are a few other links out there... https://jira.atlassian.com/browse/STASH-5480 https://answers.atlassian.com/questions/329277/making-git-suffix-for-repository-urls-optional

            ChristianS added a comment -

            yeah really odd, and i don't think that this issue will be integrated anytime soon.

            ChristianS added a comment - yeah really odd, and i don't think that this issue will be integrated anytime soon.

            import "

            {hostname}

            /

            {project_key}

            /

            {repository_slug}

            .git"

            While this does work as an interim solution, all the directories are suffixed with .git, and it does not use ssh.

            So either I have to make my repo's public, or force people to enter their user/password for every request.

            This has the added impact of ruining our automation that uses cert-based auth instead of user/password.

            Peter Dalinis added a comment - import " {hostname} / {project_key} / {repository_slug} .git" While this does work as an interim solution, all the directories are suffixed with .git, and it does not use ssh. So either I have to make my repo's public, or force people to enter their user/password for every request. This has the added impact of ruining our automation that uses cert-based auth instead of user/password.

              spetrucev Stefan
              b38832839cc0 ChristianS
              Votes:
              13 Vote for this issue
              Watchers:
              16 Start watching this issue

                Created:
                Updated:
                Resolved: