Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opencompose version shows as -not_a_git_tree, is this normal? #60

Closed
surajssd opened this issue Mar 9, 2017 · 6 comments
Closed

opencompose version shows as -not_a_git_tree, is this normal? #60

surajssd opened this issue Mar 9, 2017 · 6 comments
Assignees

Comments

@surajssd
Copy link
Contributor

surajssd commented Mar 9, 2017

Installed opencompose like this:

~/go/src/github.com/redhat-developer/opencompose [update_gitignore L|✔] 
17:36 $ go install

and the version it is showing to me:

~/go/src/github.com/redhat-developer/opencompose [update_gitignore L|✔] 
17:36 $ opencompose version
v0.0.0+000000-not_a_git_tree
@tnozicka
Copy link
Contributor

tnozicka commented Mar 9, 2017

@tnozicka tnozicka closed this as completed Mar 9, 2017
@surajssd
Copy link
Contributor Author

@tnozicka still the same

pulling latest bits

~/go/src/github.com/redhat-developer/opencompose [master ↑·40|✔] 
15:51 $ git pull --ff upstream master                                                                                                        
From github.com:redhat-developer/opencompose
 * branch            master     -> FETCH_HEAD
Already up-to-date.

installing opencompose

~/go/src/github.com/redhat-developer/opencompose [master ↑·40|✔] 
15:51 $ make install -C $GOPATH/src/github.com/redhat-developer/opencompose/                                                                 
make: Entering directory '/home/hummer/go/src/github.com/redhat-developer/opencompose'
go install 
make: Leaving directory '/home/hummer/go/src/github.com/redhat-developer/opencompose'

this is in GOPATH/bin/

~/go/src/github.com/redhat-developer/opencompose [master ↑·40|✔] 
15:52 $ which opencompose
~/go/bin/opencompose

opencompose version

~/go/src/github.com/redhat-developer/opencompose [master ↑·40|✔] 
15:52 $ opencompose version
v0.0.0+000000-not_a_git_tree

@tnozicka
Copy link
Contributor

@surajssd ok, this is strange. Can you give me the exact git sha you are on so I can try to reproduce? e.g. by git fetch --all --prune && git branch -vv

Ideally could you please also try running git describe --tags?

@tnozicka tnozicka reopened this Mar 10, 2017
@tnozicka tnozicka self-assigned this Mar 10, 2017
@surajssd
Copy link
Contributor Author

surajssd commented Mar 13, 2017

@tnozicka

here is what you requested for:

~/go/src/github.com/redhat-developer/opencompose [master ↑·42|✔] 
16:20 $ git fetch --all --prune && git branch -vv
Fetching origin
Fetching upstream
From github.com:redhat-developer/opencompose
 * [new tag]         v0.1.0-alpha.0 -> v0.1.0-alpha.0
* master           4d3727e [origin/master: ahead 42] Merge pull request #56 from tnozicka/test-for-more-golang-versions
  replicas         2c6c608 Added support for providing replicas
  spell-correction 05cc83f Spell correction in one of the errors
  update_gitignore 575b54a Updated .gitignore file


✔ ~/go/src/github.com/redhat-developer/opencompose [master ↑·42|✔] 
16:20 $ git describe --tags
v0.1.0-alpha.0-16-g4d3727e

@tnozicka
Copy link
Contributor

@surajssd Thanks for the info. I have checked revision 4d3727e and it works for me. This have to be an issue between the Makefile and your system.

Before we begin, I am not particularly proud on how we do it at this time, but please bear with me. And yes we don't check for some errors because they can be caused by your code not actually being in a git tree.

The magic is here - https://github.com/redhat-developer/opencompose/blob/master/Makefile#L7-L10
And it seems to cause this line to exclude setting versioning info for your build because one of the variables is empty.

Could you please manually check which of the variables isn't set and why?

@surajssd
Copy link
Contributor Author

~/go/src/github.com/redhat-developer/opencompose [master ↑·46|✔] 
14:51 $ rm ~/go/bin/opencompose 


✔ ~/go/src/github.com/redhat-developer/opencompose [master ↑·46|✔] 
14:56 $ make install
go install -ldflags="-X github.com/redhat-developer/opencompose/pkg/version.gitVersion=v0.1.0-alpha.0 -X github.com/redhat-developer/opencompose/pkg/version.gitCommit=377670b -X github.com/redhat-developer/opencompose/pkg/version.gitTreeState=clean"~/go/src/github.com/redhat-developer/opencompose [master ↑·46|✔] 
14:56 $ opencompose version
v0.1.0-alpha.0+377670b-clean

Now this works for me, I don't know what changed, but something surely did! Anyway thanks @tnozicka , closing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants