[OUTDATED] Important - GZDoom repository now uses submodules

Tue Oct 27, 2020 8:37 am

If you are developing on the GZDoom repository, a new change that has occurred is that it now uses a git submodule for Nash's widescreen mod.

A submodule is a link to another repository, the contents of which are not stored in the main one. The submodule can be a link to the original author's own repository, or to another one.

However - one issue with Git is it does not handle submodules automatically. It does require a little bit of remembering extra commands, especially if you're using a CUI where it is typically expected you remember this stuff automatically.

In order to do a full clone (from scratch) of GZDoom's repository now, you use the following command:
Code:
git clone https://github.com/coelckers/gzdoom --recurse-submodules


If you are updating from a pre-submoduled commit, you must do this command as well:
Code:
git pull
git submodule init
git pull --recurse-submodules

(this command only needs to be done once)

In order to do a pull for the current branch:
Code:
git pull --recurse-submodules


In order to do a fetch without updating your current branch:
Code:
git fetch --recurse-submodules


(note: --recurse might work as a shorthand for the above commands)

The extra parameter will cause git to scan and merge linked repositories as indicated by the command you used.

The commands for commit and push are unchanged.

---

If this is all correctly done, then the next time you build GZDoom, you should get a game_widescreen_gfx.pk3 file populated with the widescreen resources in their current state.

Note that this file is *NOT* commercial-project friendly, and like game_support.pk3 - *must* be removed prior to distributing the engine with a commercial game.

Re: Important - GZDoom repository now uses submodules

Tue Oct 27, 2020 10:31 am

I've tried doing a pull with recurse but it just says "Already up to date." I hope this doesn't mean I need to restart my entire project because that means I have to redo all my submissions over again.

The GUI I'm using has the ability to enable this recurse checking automatically and it usually warns that Nash's stuff isn't included with it yet. Hmm...
Last edited by Major Cooke on Tue Oct 27, 2020 10:34 am, edited 1 time in total.

Re: Important - GZDoom repository now uses submodules

Tue Oct 27, 2020 10:33 am

No. It should just automatically update.

When you compile, check the contents of game_widescreen_gfx.pk3 and verify that it contains more than just a placeholder credits.txt.

Re: Important - GZDoom repository now uses submodules

Tue Oct 27, 2020 10:57 am

Was it really necessary? All complications came with modules are simply not worth it in my opinion.
I would understand if we have an umbrella repository with a bunch of modules. One module for quite special resources is an overkill.

Re: Important - GZDoom repository now uses submodules

Tue Oct 27, 2020 11:17 am

I'm sure in time if it turns out to be too problematic it can be reversed.

Re: Important - GZDoom repository now uses submodules

Tue Oct 27, 2020 11:27 am

Actually to get the files i had to use submodule update in tortoisegit and everyone cloning the repo will have to do the same manually since there's nothing to commit after doing it.

Re: Important - GZDoom repository now uses submodules

Tue Oct 27, 2020 11:55 am

I omitted (by mistake) an important step:

If you are updating from a pre-submoduled commit, you must do this command as well:
Code:
git submodule init

(this command only needs to be done once)

Re: Important - GZDoom repository now uses submodules

Tue Oct 27, 2020 12:14 pm

In this case, the worst thing to happen would be having no widescreen images. So it's a perfect test case to see how submodules work out.
Let's just say this: At work I have to deal with a project split across 7 different repos, not using submodules because the same repos get used by other projects as well. Keeping things in sync is a logistical nightmare. We have the same issue with ZMusic which is shared by GZDoom and Raze. The current setup is a lot worse than using submodules but still better than duplicating all that rarely changing code in both repos.

Re: Important - GZDoom repository now uses submodules

Tue Oct 27, 2020 1:16 pm

Oh so that's what I was missing. Thanks Rachael!

Re: Important - GZDoom repository now uses submodules

Tue Oct 27, 2020 1:40 pm

You're welcome :)

Re: Important - GZDoom repository now uses submodules

Tue Oct 27, 2020 1:41 pm

So I'm apparently doing something wrong. I have a preexisting local repo, so I first ran
Code:
git submodule init

There was no error, and no output. I then ran
Code:
git fetch gzdoom --recurse-submodules

(gzdoom is for Graf's remote repo, origin is my fork). This fetched as normal. Then did
Code:
git rebase gzdoom/master

and it successfully rebased. At this point, I see a wadsrc_widescreen directory with a CMakeLists.txt, but wadsrc_widescreen/static is empty. I tried running
Code:
git submodule init

again, and this time it said something about setting up another repository (exact message is gone now, unfortunately), but wadsrc_widescreen/static is still empty. Ran
Code:
git fetch gzdoom --recurse-submodules
git rebase gzdoom/master

again, and it's still empty. Building GZDoom creates game_widescreen_gfx.pk3 with 0 files.

I've never had a positive experience with submodules.

Re: Important - GZDoom repository now uses submodules

Tue Oct 27, 2020 1:46 pm

Ack, yeah, still getting this issue. That happens when Im going to push to my github itself.

Re: Important - GZDoom repository now uses submodules

Tue Oct 27, 2020 2:04 pm

@ Chris & Cooke:

Try doing a "git pull --recurse" (after the init) and see if that fixes it.

Re: Important - GZDoom repository now uses submodules

Tue Oct 27, 2020 2:07 pm

For what it's worth, for TortoiseGit users like me, the top answer on this page (31 votes at the time of the post) was the most straightfoward way. I was able to get GZDoom to build a proper copy of game_widescreen_gfx.pk3.

Re: Important - GZDoom repository now uses submodules

Tue Oct 27, 2020 2:16 pm

TortoiseGit has a "Submodule update..." entry in its context menu, that always does the trick. So far every time I had problems with submodules, "git submodule update" solved them, especially on macOS where all Git clients are shit, especially the expensive ones :twisted: