jspm / github

Github Location Service
16 stars 43 forks source link

refs/tags/<version>^{} and refs/tags/<version>, later entry wins? #79

Closed henrjk closed 8 years ago

henrjk commented 8 years ago

I was just following along some code here and where looking at:

$ git ls-remote git@github.com:anvilresearch/connect.git 'refs/tags/*'  | grep 0.1.0 
81f497143a05681b740115319b0df5f21ae9df60    refs/tags/0.1.0
c9d2983cda89d5d6a6cabaf8ccb84f19845c5fab    refs/tags/0.1.0^{}

and the code around https://github.com/jspm/github/blob/18da66d2e002c80937a9c476dde019b7dd26d351/github.js#L398

          else if (refName.substr(0, 10) == 'refs/tags/') {
            if (refName.substr(refName.length - 3, 3) == '^{}')
              version = refName.substr(10, refName.length - 13);
            else
              version = refName.substr(10);
        ....
          versions[version] = versionObj;

Here is some more info on what '^{}' means: http://stackoverflow.com/questions/12938972/what-does-mean-in-git .

It seems that versions['0.1.0'] would be what happens? to come later in the output of git ls-remote. I am not sure this a problem at all, but it might warrant checking.

guybedford commented 8 years ago

Yes exactly. I guess it just says that it is a tag which is irrelevant info for our use of the output since we're just extracting tag and branch names.