Jump to content

Revisionnumber, Manually added?


Guest Peec

Recommended Posts

Mangos is now ported to git wich is really nice by the way!

I was wondering:

We have a revision number right now, example:

[root@mangos mangos]# git --no-pager log --max-count=1

commit 837017e8f4a723843ff7e6bc2b2d8fceb5b61834

Author: Ambal <[email protected]>

Date: Tue Sep 22 00:23:41 2009 +0300

[8526] Added upper limit for cell search radius, affect max visibility and AOE spell range. Set to 333 yards.

You see the [8526] , is this revision a manual job for the developers?

SVN was based on these revision numbers, but does git support this, or do developers add it like manually to the title and add sql updates with the titles number?

So if i want to create an automatic process to fetch the "Revision number" of MaNGOS, i would have to parse the information i get from "git --no-pager log --max-count=1" , and find the number between the [ and ] tags ?

Link to comment
Share on other sites

Since the developers are now using my tool to backport commits from master to mangos-0.12 (and elsewhere), it should be possible to specify the commit as

[1234]

ie.

git reset --hard [9000]

(which works on recent commits, older ones were cherry-picked which left the number there)

Only commits in the master branch should have those numbers.

And yes, developers add the number there using Wyk3d's "git_id" tool. I'm not really a big fan of it, but as long as it makes their work easier, I don't care.

Link to comment
Share on other sites

And git_id tool do many more that jst add number to notes.

1) It also generate revison header for project itself

2) with special option can propertly rename and register in project sql updates with related makefile/.sql files update and generate another header for DB version data for loading check + add sql update order guards in sql update to prevent wrong apply order.

Link to comment
Share on other sites

Thanks for the constructive comments to this case freghar & Vladimir!

I'm actually working on a object oriented installer for mangos (php commandline based), so that's why i needed to find out how these revision numbers are generated.

I will do a parse to find the revision number, actually i found that this command:

git --no-pager log --max-count=1 --pretty="oneline"

Will be the best to parse from , because it Generates a post like this:837017e8f4a723843ff7e6bc2b2d8fceb5b61834 [8526] Added upper limit for cell search radius, affect max visibility and AOE spell range. Set to 333 yards.

Just require explode(' ', $s) and str_replace :) Simple and easy.

I'm not a fan of parsing strings that is not 100% sure to be in correct format but i guess its Ok :)

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use