My use case for git submodules

I have been chatting on IRC about how I’m learning git so I can use submodules and my friend @indigo wants to know my use case, so this post makes some effort to explain that with reference to one specific example.

I have a web framework/toolkit I am experimenting with called Mudball which is here: https://github.com/jj5/mudball

I use Mudball in (some of) my web projects, for example: https://github.com/jj5/www.jjlab.net

In the main project (in this case www.jjlab.net) I have a copy of Mudball in the ext/mudball directory. At the moment ext/mudball is setup as a git submodule.

I open the main project in my IDE (or text editor) and I want to be able to work on both the main application and the web framework/toolkit at the same time. Then when I’m done with some changes I want to run my `gui` script (it stands for “git update interactive”, not “graphical user interface”) which will increment my version numbers in inc/version.php and ext/mudball/inc/version.php and then add/commit/push any changes in both the main project and the web framework/toolkit.

The code for the `gui` command is here: kickass-libexec/bin/lx-gui.sh, it mostly just defers to lx_vcs_sync() which is here: kickass-libexec/src/2-module/vcs/vcs.sh.

The code which updates the version numbers is here: kickass-libexec/bin/lx-version-increment-patch.sh, it mostly just defers to other modules which are here: kickass-libexec/bin/libexec/version-increment-patch.php and here: kickass-libexec/bin/libexec/inc/version.php.

I have been using a similar setup for a long time with Subversion which uses the svn:externals facility (in place of git submodules) and I have a few scripts which help me manage that. My main tooling for this is known as svnman which is a bunch of scripts I wrote myself: Svnman.

I figured out how to avoid connascence of position

Instead of passing positional arguments to constructors (or functions), instead pass a list of value objects. The type of the value object will tell you the type of the value, so you don’t need to worry about the position. This is a super powerful means of supporting back-compat within your code base so you can move ahead at speed. Having value objects instead of simple types (bools, ints, floats, strings, etc) might have performance implications, but it also can be quite handy. So far so good for my use cases.

Electronics Project #7: ICL8038 Monolithic Function/Signal Generator Kit Build and Test | In The Lab

This post is part of my video blog and you can find more information about this video over here.

You can support this channel on Patreon: patreon.com/JohnElliotV

Silly Job Title: Buzz Boss

In this video I build and test this kit I purchased from AliExpress: ICL8038 Monolithic Function Signal Generator Module Sine Square Triangle Signal Generators DIY Welding Practice Kit.

My notes are on my wiki: ICL8038.

Thanks very much for watching! And please remember to hit like and subscribe! :)


Following is a product I use picked at random from my collection which may appear in my videos. Clicking through on this to find and click on the green affiliate links before purchasing from eBay or AliExpress is a great way to support the channel at no cost to you. Thanks!

Swann & Morten Handle For No. 10 10A 11 15 15A Scalpel HandleThis is an image of the product.

Let’s go shopping!

InTheLabWithJayJay.com now with RSS feed

I added RSS capabilities for InTheLabWithJayJay.com. You can subscribe to the whole thing, or just one channel, or just one show, or just one feature… it was difficulty to create the UI to support that without overcomplicating things. I made the link on the RSS icon support different feed depending on which page you are on.

Refactoring jjlab.net

I just spent two whole days refactoring and improving my jjlab.net website.

One thing I had to think very carefully about for my modeling was the class/instance distinction for various things, you can see my notes below.

So channels have shows, and shows have features.

A series has segments, and segments have a video.

A series is an instance of a show, and a segment is an instance of a feature.

Everything is easy when you know how!

John's notes about the design of his model

Announcing new website for In The Lab With Jay Jay

Good news everyone!

The In The Lab With Jay Jay website has been freeloading off jj5.net for a while now, over here: https://www.inthelabwithjayjay.com/in-the-lab/

But I am pleased to announce that it has now been moved into its new and permanent home, over here: InTheLabWithJayJay.com

There is also a short-link domain which will redirect you to the new site which I put into production to keep the links on my business cards short: jjlab.net

Speaking of business cards I had some made to take with me to ElectroneX on Wednesday:

John's new business card for In The Lab With Jay Jay

I’m planning to show up in costume and hand out business cards, because I am a *genuine* nerd.

As part of the migration to the new domain I improved the content of the site a bit. There is now an about page with contact info and such and also a support the show page with some ideas about how people can support the show!