[OUTDATED] Important - GZDoom repository now uses submodules

Here, developers communicate stuff that does not go onto the main News section or the front page of the site.
[Dev Blog] [Development Builds] [Git Change Log] [GZDoom Github Repo]

Moderator: GZDoom Developers

User avatar
Rachael
Posts: 13562
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

[OUTDATED] Important - GZDoom repository now uses submodules

Post by Rachael »

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: Select all

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: Select all

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: Select all

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

Code: Select all

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.
User avatar
Major Cooke
Posts: 8175
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: Important - GZDoom repository now uses submodules

Post by Major Cooke »

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.
User avatar
Rachael
Posts: 13562
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Important - GZDoom repository now uses submodules

Post by Rachael »

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.
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: Important - GZDoom repository now uses submodules

Post by _mental_ »

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.
User avatar
Rachael
Posts: 13562
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Important - GZDoom repository now uses submodules

Post by Rachael »

I'm sure in time if it turns out to be too problematic it can be reversed.
User avatar
drfrag
Vintage GZDoom Developer
Posts: 3141
Joined: Fri Apr 23, 2004 3:51 am
Location: Spain
Contact:

Re: Important - GZDoom repository now uses submodules

Post by drfrag »

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.
User avatar
Rachael
Posts: 13562
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Important - GZDoom repository now uses submodules

Post by Rachael »

I omitted (by mistake) an important step:

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

Code: Select all

git submodule init
(this command only needs to be done once)
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Important - GZDoom repository now uses submodules

Post by Graf Zahl »

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.
User avatar
Major Cooke
Posts: 8175
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: Important - GZDoom repository now uses submodules

Post by Major Cooke »

Oh so that's what I was missing. Thanks Rachael!
User avatar
Rachael
Posts: 13562
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Important - GZDoom repository now uses submodules

Post by Rachael »

You're welcome :)
User avatar
Chris
Posts: 2942
Joined: Thu Jul 17, 2003 12:07 am
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Re: Important - GZDoom repository now uses submodules

Post by Chris »

So I'm apparently doing something wrong. I have a preexisting local repo, so I first ran

Code: Select all

git submodule init
There was no error, and no output. I then ran

Code: Select all

git fetch gzdoom --recurse-submodules
(gzdoom is for Graf's remote repo, origin is my fork). This fetched as normal. Then did

Code: Select all

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: Select all

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: Select all

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.
User avatar
Major Cooke
Posts: 8175
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: Important - GZDoom repository now uses submodules

Post by Major Cooke »

Ack, yeah, still getting this issue. That happens when Im going to push to my github itself.
User avatar
Rachael
Posts: 13562
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Important - GZDoom repository now uses submodules

Post by Rachael »

@ Chris & Cooke:

Try doing a "git pull --recurse" (after the init) and see if that fixes it.
User avatar
Nash
 
 
Posts: 17439
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Important - GZDoom repository now uses submodules

Post by Nash »

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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Important - GZDoom repository now uses submodules

Post by Graf Zahl »

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:
Post Reply

Return to “Developer Blog”