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

Adds the option to see the current git commit with ipfs version --commit #1853

Merged
merged 1 commit into from
Oct 18, 2015
Merged

Adds the option to see the current git commit with ipfs version --commit #1853

merged 1 commit into from
Oct 18, 2015

Conversation

caioalonso
Copy link
Contributor

It sets the variable config.CurrentCommit in the Makefile with the short SHA1 hash of the current commit.

It also adds the --commit option to ipfs version so that:

$ ipfs version
ipfs version 0.3.8-dev

$ ipfs version --commit
ipfs version 0.3.8-dev-4de5eaa

$ ipfs version --number
0.3.8-dev

$ ipfs version --number --commit
0.3.8-dev-4de5eaa

…mmit`

License: MIT
Signed-off-by: Caio Alonso <caio@caioalonso.com>
@jbenet jbenet added the backlog label Oct 17, 2015
@rht
Copy link
Contributor

rht commented Oct 18, 2015

Also useful to know how old the commit is.

$ ipfs version --commit
ipfs version 0.3.8-dev-4de5eaa (x days old)

@@ -5,6 +5,8 @@ else
go_test=go test
endif

commit = `git rev-parse --short HEAD`
ldflags = "-X "github.com/ipfs/go-ipfs/repo/config".CurrentCommit=$(commit)"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is cool, didn't know it was possible.

@jbenet
Copy link
Member

jbenet commented Oct 18, 2015

LGTM, thanks! (we can add date as a separate thing later on)

jbenet added a commit that referenced this pull request Oct 18, 2015
Adds the option to see the current git commit with `ipfs version --commit`
@jbenet jbenet merged commit 0f909cb into ipfs:master Oct 18, 2015
@jbenet jbenet removed the backlog label Oct 18, 2015
@caioalonso caioalonso deleted the show-commit-hash branch October 18, 2015 17:05
@whyrusleeping
Copy link
Member

unfortunately, we wont be able to get this information through gobuilder binaries...

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

Successfully merging this pull request may close these issues.

None yet

4 participants