iw4x / iw4x-client

GNU General Public License v3.0
123 stars 42 forks source link

fix: Add git tags if missing #150

Open SnowyWhite opened 1 month ago

SnowyWhite commented 1 month ago

What does this PR do?

This PR adds a small fix to the generate.bat script.

If you fork this repository, then GitHub, by default, only copies the develop branch: image

The problem here is that the premake5.lua script requires git tags in order to generate the build information file. Because of this, compiling a forked clone with the default settings will fail.

The easiest fix to this problem is to simply add the original repository as an upstream remote and then fetching / pushing the git tags to the fork. That's exactly what this PR does: It first checks if there is an upstream remote, and if not, adds it and copies the git tags.

Anything else we should know?

It would probably be enough to just copy the most recent tag. However, for the sake of completeness, it will copy them all once when it generates the solution.

Another solution would be to edit the lua script, but I have no experience with Lua and, I believe, it would require the creation of a new tag, which could potentially have some caveats.

Laupetin commented 1 month ago

Wouldn't it be also an option to make generating build information in premake work without tags? If there are none it could use a hardcoded value like "fork" or "dev" or whatever since i guess if you dont copy tags when forking it might be okay to not have the latest tag information.

diamante0018 commented 3 weeks ago

I think the premake5 script needs to be edited indeed

mxve commented 3 weeks ago

I think the tag-based versions aren't used anywhere anymore, so maybe we should get rid of them altogether.

https://github.com/iw4x/iw4x-client/pull/145

Rackover commented 4 days ago

So what do we think? We pull the tags as part of generate or we stop using the tags in premake entirely?

If they're not useful I'm up for not using them in premake, or making them facultative so that nobody's branch breaks when they remove all tags (you wouldn't expect that to break a build)

Let me know so we can merge that in before next release