Posts: 24
Threads: 8
Joined: Jul 2013
Reputation:
0
11-21-2013, 07:39 AM
(This post was last modified: 11-22-2013, 01:25 PM by fastrizwaan.)
I'm building RPM for fedora, I want to get the git version like v.0.9.5-XXXXXXX , when a commit happens and we do git fetch
When we compile ppsspp, we can see git-version.cpp, but how do I know the latest full revision number?
thanks.
Posts: 456
Threads: 1
Joined: Nov 2013
Reputation:
23
it's just "git describe --always" at least that's what's used to generate the git-version.cpp
Posts: 3,228
Threads: 25
Joined: Nov 2012
Reputation:
98
Henrik: open your .gitconfig file or etc. and add this under [alias]:
find-commit = "!START_POINT="`echo "$1" | sed -e 's/-.*$//'`"; git describe --always `git rev-list "$START_POINT"..master` | grep "$1-" && true"
Use e.g. "git find-commit v0.9.5-3". But it's still a pain and can be slow or ambiguous.
Another useful one:
get-merge = "!git log --ancestry-path $1..master --oneline --merges | tail -n1 && true"
Use e.g. "git get-merge c2b2b36" which will tell you it's pull #4417.
As for packaging, yes, just use git describe --always. I believe it has to be done from within the git directory.
-[Unknown]
Posts: 24
Threads: 8
Joined: Jul 2013
Reputation:
0
Thanks unknown and Bigpet! that helped a lot for making rpm.