On 15/02/13 12:00, Tom Hacohen wrote: > On 15/02/13 11:49, Doug Newgard wrote: >> m4/efl.m4 is still trying to call svnversion or git-svn-id to get the >> dev_version. >> >> I don't have an easy fix, git doesn't have anything quite like the svn >> revisions. >> git describe can get you the count of the number of commits since the last >> annotated tag, but there are no tags in the EFL git repo yet. >> >> Just wanted to make people aware. It only shows up as an error if you don't >> have svn installed, so I figured it might not get noticed right away. > > Haha, so funny. I just thought about it as well (been trying to figure > this out for the last couple of minutes). > > The thing is, that there's git describe. Git describe can give the > version information easily. For example, from the 1.7 branch: > v1.7.5-21-ga0f2638 > > i.e, head is 21 commits after the tag, it's commit hash is ga0... and etc. > > The problem with that is that we have "revision" as int in Eina_Version, > and that obviously doesn't work well with strings. > > Daniel and I have been trying to think about it. I say we can try to use > git describe when it works (just get the "count after tag"), and when it > doesn't (i.e if there are no tags) count the commits in the history in > order to get a count. This is not perfect, but can work. > > What do you guys think? >
Ok, so what we did: We use "git rev-list --count HEAD" in order to get the count of the commits in a branch and we use it as a "revision" in the version structure. Probably not interesting part: You can jump to a specific commit revision (of the same branch) by doing the following: git checkout HEAD~$(expr $(git rev-list --count HEAD) - REVISION) where REVISION is the revision number (*not* compatible with svn revs). For example: git checkout HEAD~$(expr $(git rev-list --count HEAD) - 1753) It's important to note that this is probably not interesting for the most of you because this is really a rare thing to want to do, but just in case... -- Tom. ------------------------------------------------------------------------------ Free Next-Gen Firewall Hardware Offer Buy your Sophos next-gen firewall before the end March 2013 and get the hardware for free! Learn more. http://p.sf.net/sfu/sophos-d2d-feb _______________________________________________ enlightenment-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
