Jump to content

Topic on Project talk:WikiProject Extensions

Git submodules, subtree, or symlinks?

3
Negative24 (talkcontribs)

I have a MediaWiki installation that I want to keep linked to the mediawiki/core branch so that I can keep updated with the code. That MediaWiki installation would be used for testing of my extension that I'm writing which would be written in the regular /extensions/MyExtension directory but I would also like to use a local git repo to keep track of my extension's changes. Should I use git submodules, git subtree or symlinks so that I have a git repo in my /extensions/MyExtension as well as the mediawiki/core? What do you use/recommend? Thanks,

Seb35 (talkcontribs)

To write and live-test my extension, I have a symlink from core/extensions/MyExtension to my extension directory, but you can also `cd core/extensions; git clone /your/extension/MyExtension` if you want to keep control of the deployed version. You can be interested by MediaWiki-Vagrant (I cannot give advices with that, I didn’t succeed in installing it).

GregRundlett (talkcontribs)

There is a .gitignore file in mediawiki/extensions/ that ignores everything in 'extensions' so MyExtension will not "interfere" at all with updating your core checkout.

If your extension is brand new and you aren't hosting the code anywhere (meaning there is no "remote" for your code), just create a git repo in your project folder itself. ie.

# create a MyExtension directory in the extensions/ folder.  
MyExtension=AcmeWidgets
cd path/to/core/extensions
mkdir $MyExtension
cd $MyExtension
# hack hack hack
git init .
git add . -m "initial commit of $MyExtension code"
# hack hack hack
git commit -am "some more improvement, getting close to feature complete"

Later, when your extension is ready to be published, you can add a remote to your $MyExtension and push it there (including gerrit.mediawiki.org if you want to host there and follow guidelines) I believe you would only use a submodule if $MyExtension were to be deployed with a specific release of MediaWiki proper.

If you want to develop $MyExtension against a specific release of MediaWiki, then after cloning core, checkout the branch you desire.

Reply to "Git submodules, subtree, or symlinks?"