FAQ
With github enterprise I have to use an extra "*.git*" at the end of the
repo string when running go get, like this:


*go get git.mycompany.com/myname/foo.git.git*

*go get git.mycompany.com/myname/foo.git *does not work.

I looked into the *vcs.go* source code, the regex that parse this import
path is this:

*^(?P<root>(?P<repo>([a-z0-9.\-]+\.)+[a-z0-9.\-]+(:[0-9]+)?/[A-Za-z0-9_.\-/]*?)\.(?P<vcs>bzr|git|hg|svn))(/[A-Za-z0-9_.\-]+)*$*

This is from *line 612* at *http://golang.org/src/cmd/go/vcs.go*

Notice that *<repo>* group does not contain the *<vcs>* group. So after
parsing, the repo group ends up being *"git.mycompany.com/myname/foo"*, if
parsing against* "git.mycompany.com/myname/foo.git"*

Then the ping command: *git ls-remote* is run against the repo group, which
won't work without *.git* suffix!

Hope I have explained this problem clear enough, anyway the solution is to
include the vcs group inside the repo group like this:

*^(?P<root>(?P<repo>([a-z0-9.\-]+\.)+[a-z0-9.\-]+(:[0-9]+)?/[A-Za-z0-9_.\-/]*?\.(?P<vcs>bzr|git|hg|svn)))(/[A-Za-z0-9_.\-]+)*$*


Also I haven't found any test cases for the *vcs.go *code....

Thanks,

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Jesse McNelis at Dec 5, 2013 at 2:57 am

    On Thu, Dec 5, 2013 at 8:26 AM, Qiang Han wrote:

    With github enterprise I have to use an extra "*.git*" at the end of the
    repo string when running go get, like this:


    *go get git.mycompany.com/myname/foo.git.git
    <http://git.mycompany.com/myname/foo.git.git>*

    *go get git.mycompany.com/myname/foo.git
    <http://git.mycompany.com/myname/foo.git> *does not work.

    I looked into the *vcs.go* source code, the regex that parse this import
    path is this:


    *^(?P<root>(?P<repo>([a-z0-9.\-]+\.)+[a-z0-9.\-]+(:[0-9]+)?/[A-Za-z0-9_.\-/]*?)\.(?P<vcs>bzr|git|hg|svn))(/[A-Za-z0-9_.\-]+)*$*

    This is from *line 612* at *http://golang.org/src/cmd/go/vcs.go
    <http://golang.org/src/cmd/go/vcs.go>*
    Notice that *<repo>* group does not contain the *<vcs>* group. So after
    parsing, the repo group ends up being *"git.mycompany.com/myname/foo
    <http://git.mycompany.com/myname/foo>"*, if parsing against* "git.mycompany.com/myname/foo.git
    <http://git.mycompany.com/myname/foo.git>"*
    Then the ping command: *git ls-remote* is run against the repo group,
    which won't work without *.git* suffix!
    Hope I have explained this problem clear enough, anyway the solution is to
    include the vcs group inside the repo group like this:

    *^(?P<root>(?P<repo>([a-z0-9.\-]+\.)+[a-z0-9.\-]+(:[0-9]+)?/[A-Za-z0-9_.\-/]*?\.(?P<vcs>bzr|git|hg|svn)))(/[A-Za-z0-9_.\-]+)*$*
    Also I haven't found any test cases for the *vcs.go *code....
    This is intentional. The '.git' at the end of a import string is an
    indication to 'go get' to use git to fetch the repo.
    The fact that github enterprise names it's repos with a '.git' is
    unfortunate.

    --
    =====================
    http://jessta.id.au

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Josh Bleecher Snyder at Dec 5, 2013 at 3:21 am
    See also
    https://groups.google.com/forum/m/#!msg/golang-nuts/AURCoVLjNyc/2Uw7A_-LRfQJ


    On Wednesday, December 4, 2013, Jesse McNelis wrote:

    On Thu, Dec 5, 2013 at 8:26 AM, Qiang Han ({}, 'cvml', 'qjavaswing2009@gmail.com');>
    wrote:
    With github enterprise I have to use an extra "*.git*" at the end of the
    repo string when running go get, like this:


    *go get git.mycompany.com/myname/foo.git.git
    <http://git.mycompany.com/myname/foo.git.git>*

    *go get git.mycompany.com/myname/foo.git
    <http://git.mycompany.com/myname/foo.git> *does not work.

    I looked into the *vcs.go* source code, the regex that parse this import
    path is this:


    *^(?P<root>(?P<repo>([a-z0-9.\-]+\.)+[a-z0-9.\-]+(:[0-9]+)?/[A-Za-z0-9_.\-/]*?)\.(?P<vcs>bzr|git|hg|svn))(/[A-Za-z0-9_.\-]+)*$*

    This is from *line 612* at *http://golang.org/src/cmd/go/vcs.go
    <http://golang.org/src/cmd/go/vcs.go>*
    Notice that *<repo>* group does not contain the *<vcs>* group. So after
    parsing, the repo group ends up being *"git.mycompany.com/myname/foo
    <http://git.mycompany.com/myname/foo>"*, if parsing against* "git.mycompany.com/myname/foo.git
    <http://git.mycompany.com/myname/foo.git>"*
    Then the ping command: *git ls-remote* is run against the repo group,
    which won't work without *.git* suffix!
    Hope I have explained this problem clear enough, anyway the solution is
    to include the vcs group inside the repo group like this:

    *^(?P<root>(?P<repo>([a-z0-9.\-]+\.)+[a-z0-9.\-]+(:[0-9]+)?/[A-Za-z0-9_.\-/]*?\.(?P<vcs>bzr|git|hg|svn)))(/[A-Za-z0-9_.\-]+)*$*
    Also I haven't found any test cases for the *vcs.go *code....
    This is intentional. The '.git' at the end of a import string is an
    indication to 'go get' to use git to fetch the repo.
    The fact that github enterprise names it's repos with a '.git' is
    unfortunate.

    --
    =====================
    http://jessta.id.au

    --
    You received this message because you are subscribed to the Google Groups
    "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-nuts+unsubscribe@googlegroups.com <javascript:_e({},
    'cvml', 'golang-nuts%2Bunsubscribe@googlegroups.com');>.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Qiang Han at Dec 5, 2013 at 6:02 am
    Agreed, but the code should be smart enough to use just one ".git" to
    figure out that it is a git repository. Even .git is part of a repo name.
    On Wednesday, December 4, 2013 6:57:18 PM UTC-8, Jesse McNelis wrote:

    On Thu, Dec 5, 2013 at 8:26 AM, Qiang Han <qjavasw...@gmail.com<javascript:>
    wrote:
    With github enterprise I have to use an extra "*.git*" at the end of the
    repo string when running go get, like this:


    *go get git.mycompany.com/myname/foo.git.git
    <http://git.mycompany.com/myname/foo.git.git>*

    *go get git.mycompany.com/myname/foo.git
    <http://git.mycompany.com/myname/foo.git> *does not work.

    I looked into the *vcs.go* source code, the regex that parse this import
    path is this:


    *^(?P<root>(?P<repo>([a-z0-9.\-]+\.)+[a-z0-9.\-]+(:[0-9]+)?/[A-Za-z0-9_.\-/]*?)\.(?P<vcs>bzr|git|hg|svn))(/[A-Za-z0-9_.\-]+)*$*

    This is from *line 612* at *http://golang.org/src/cmd/go/vcs.go
    <http://golang.org/src/cmd/go/vcs.go>*
    Notice that *<repo>* group does not contain the *<vcs>* group. So after
    parsing, the repo group ends up being *"git.mycompany.com/myname/foo
    <http://git.mycompany.com/myname/foo>"*, if parsing against* "git.mycompany.com/myname/foo.git
    <http://git.mycompany.com/myname/foo.git>"*
    Then the ping command: *git ls-remote* is run against the repo group,
    which won't work without *.git* suffix!
    Hope I have explained this problem clear enough, anyway the solution is
    to include the vcs group inside the repo group like this:

    *^(?P<root>(?P<repo>([a-z0-9.\-]+\.)+[a-z0-9.\-]+(:[0-9]+)?/[A-Za-z0-9_.\-/]*?\.(?P<vcs>bzr|git|hg|svn)))(/[A-Za-z0-9_.\-]+)*$*
    Also I haven't found any test cases for the *vcs.go *code....
    This is intentional. The '.git' at the end of a import string is an
    indication to 'go get' to use git to fetch the repo.
    The fact that github enterprise names it's repos with a '.git' is
    unfortunate.

    --
    =====================
    http://jessta.id.au
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Jesse McNelis at Dec 5, 2013 at 6:14 am

    On Thu, Dec 5, 2013 at 5:02 PM, Qiang Han wrote:
    Agreed, but the code should be smart enough to use just one ".git" to figure out that it is a git repository. Even .git is part of a repo name.

    How would it do that? What if you had two repos
    git.mycompany.com/myname/foo
    and
    git.mycompany.com/myname/foo.git

    How would go get know if you meant to access
    git.mycompany.com/myname/foo.git or git.mycompany.com/myname/foo ?




    --
    =====================
    http://jessta.id.au

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Qiang Han at Dec 5, 2013 at 6:34 am
    Can this by solved by pinging the repo? Using something like "git
    ls-remote", if the ping succeeded, then use that as repo name.
    On Wednesday, December 4, 2013 10:14:45 PM UTC-8, Jesse McNelis wrote:
    On Thu, Dec 5, 2013 at 5:02 PM, Qiang Han wrote:

    Agreed, but the code should be smart enough to use just one ".git" to
    figure out that it is a git repository. Even .git is part of a repo name.


    How would it do that? What if you had two repos
    git.mycompany.com/myname/foo
    and
    git.mycompany.com/myname/foo.git

    How would go get know if you meant to access
    git.mycompany.com/myname/foo.git or git.mycompany.com/myname/foo ?




    --
    =====================
    http://jessta.id.au
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedDec 5, '13 at 1:31a
activeDec 5, '13 at 6:34a
posts6
users3
websitegolang.org

People

Translate

site design / logo © 2020 Grokbase