{"action":"created","issue":{"url":"https://api.github.com/repos/minetest/minetest/issues/4822","repository_url":"https://api.github.com/repos/minetest/minetest","labels_url":"https://api.github.com/repos/minetest/minetest/issues/4822/labels{/name}","comments_url":"https://api.github.com/repos/minetest/minetest/issues/4822/comments","events_url":"https://api.github.com/repos/minetest/minetest/issues/4822/events","html_url":"https://github.com/minetest/minetest/issues/4822","id":192724440,"number":4822,"title":"Lua API: Expose Minetest version number in an actually useful format","user":{"login":"Wuzzy2","id":1675853,"avatar_url":"https://avatars.githubusercontent.com/u/1675853?v=3","gravatar_id":"","url":"https://api.github.com/users/Wuzzy2","html_url":"https://github.com/Wuzzy2","followers_url":"https://api.github.com/users/Wuzzy2/followers","following_url":"https://api.github.com/users/Wuzzy2/following{/other_user}","gists_url":"https://api.github.com/users/Wuzzy2/gists{/gist_id}","starred_url":"https://api.github.com/users/Wuzzy2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wuzzy2/subscriptions","organizations_url":"https://api.github.com/users/Wuzzy2/orgs","repos_url":"https://api.github.com/users/Wuzzy2/repos","events_url":"https://api.github.com/users/Wuzzy2/events{/privacy}","received_events_url":"https://api.github.com/users/Wuzzy2/received_events","type":"User","site_admin":false},"labels":[{"id":73368983,"url":"https://api.github.com/repos/minetest/minetest/labels/@%20Script%20API","name":"@ Script API","color":"009800","default":false},{"id":9903065,"url":"https://api.github.com/repos/minetest/minetest/labels/Won't%20add","name":"Won't add","color":"bb88bb","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-12-01T00:46:30Z","updated_at":"2016-12-01T16:07:09Z","closed_at":null,"body":"I was excited when `minetest.get_version` was added, but got quickly disappointed:\r\n\r\n```\r\n* `minetest.get_version()`: returns a table containing components of the\r\n    engine version.  Components:\r\n     * `project`: Name of the project, eg, \"Minetest\"\r\n     * `string`: Simple version, eg, \"1.2.3-dev\"\r\n     * `hash`: Full git version (only set if available), eg, \"1.2.3-dev-01234567-dirty\"\r\n   Use this for informational purposes only. The information in the returned\r\n   table does not represent the capabilities of the engine, nor is it\r\n   reliable or verifyable. Compatible forks will have a different name and\r\n   version entirely. To check for the presence of engine features, test\r\n   whether the functions exported by the wanted features exist. For example:\r\n   `if core.nodeupdate then ... end`.\r\n```\r\n\r\nIn other words, this function is (sadly) useless for most practical purposes. Number 1 use is of course to check if Minetest is in a particular version in order to find out whether a feature is available. This will it make much easier to write compability checks.\r\n\r\nThe suggestion that modders should just check if a function is `nil` is not really helping. It ignores the fact that not all features can be checked that way. For example, formspec elements. Here the only reliable way would be to know the actual version number.\r\n\r\nMy suggestion is to just add another field which includes 3 numbers (`major`, `minor`, `patch`) and maybe  a 4th field `release_type` which is `\"development\"` or `\"release\"` (for “-dev” or non-“-dev” versions) . The idea is to store the values atomically so they can be easily interpreted.\r\n\r\nE.g. Minetest 0.4.14 would be:\r\n```\r\n-- (…)\r\nmajor=0,\r\nminor=4,\r\npatch=14,\r\nrelease_type=\"release\",\r\n-- (…)\r\n```\r\n\r\nCan you please try to squeeze this in before the feature freeze? It will be a relief for many modders, I guess."},"comment":{"url":"https://api.github.com/repos/minetest/minetest/issues/comments/264214479","html_url":"https://github.com/minetest/minetest/issues/4822#issuecomment-264214479","issue_url":"https://api.github.com/repos/minetest/minetest/issues/4822","id":264214479,"user":{"login":"Wuzzy2","id":1675853,"avatar_url":"https://avatars.githubusercontent.com/u/1675853?v=3","gravatar_id":"","url":"https://api.github.com/users/Wuzzy2","html_url":"https://github.com/Wuzzy2","followers_url":"https://api.github.com/users/Wuzzy2/followers","following_url":"https://api.github.com/users/Wuzzy2/following{/other_user}","gists_url":"https://api.github.com/users/Wuzzy2/gists{/gist_id}","starred_url":"https://api.github.com/users/Wuzzy2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wuzzy2/subscriptions","organizations_url":"https://api.github.com/users/Wuzzy2/orgs","repos_url":"https://api.github.com/users/Wuzzy2/repos","events_url":"https://api.github.com/users/Wuzzy2/events{/privacy}","received_events_url":"https://api.github.com/users/Wuzzy2/received_events","type":"User","site_admin":false},"created_at":"2016-12-01T16:07:09Z","updated_at":"2016-12-01T16:07:09Z","body":"“misuse”? o_O\r\nOK, the what is the “correct” way then to learn e.g. what formspec elements are available?"}}
{"actor":{"display_login":"Wuzzy2"}}