Hallo.
Try selecting the text in the above paragraph with your mouse—it's kinda fun.
You may find some of my humble ~/.bashrc useful. If you copy anything from here, make sure to make adaptations. I make no guarantee that any of this will work on your machine.
# User specific aliases and functions
export MY_MW=~/devel/core # That's the path for core MediaWiki, and it may be different for you
export GERRIT_USERNAME=amire80 # You should put your Gerrit username here
# Go to the main branch of the local git repo,
# and try to take master/main/stable name variations
# into account.
# Don't expect it to be universally robust - it works
# for the repos with which I work.
function gitmain {
git show-ref --verify --quiet refs/heads/master
if [ $? -eq 0 ]; then
git checkout master;
else
git show-ref --verify --quiet refs/heads/main
if [ $? -eq 0 ]; then
git checkout main;
else
git checkout stable;
fi
fi
}
function core_clone { git clone ssh://$GERRIT_USERNAME@gerrit.wikimedia.org:29418/mediawiki/core.git $1; }
function ext_clone {
if [ -n "$1" ]; then
git clone ssh://$GERRIT_USERNAME@gerrit.wikimedia.org:29418/mediawiki/extensions/$1;
else
echo "Which extension?";
fi
}
function skin_clone { git clone ssh://$GERRIT_USERNAME@gerrit.wikimedia.org:29418/mediawiki/skins/$1; }
function mwupdate { docker compose exec mediawiki composer update; docker-compose exec mediawiki php maintenance/update.php; }
function mwstart { docker compose up -d; }
function mwstop { docker compose down; }
function mwbash { docker compose exec mediawiki bash; }
function amend { git commit -a --amend; }
function amendn { git commit -a --amend --no-edit; }
function pull { gitmain && git fetch origin && git pull --ff-only; }
function review { git fetch --all; git review; }
function fetch { git fetch --all; }
function squash { git rebase -i HEAD~$1; }
function gc { git gc; }
function good { git bisect good; }
function bad { git bisect bad; }
function branch { git checkout -b $1; }
function ext () { cd $MY_MW/extensions/; }
function lamb () { cd $MY_MW/extensions/WikiLambda; }
function mf () { cd $MY_MW/extensions/MobileFrontend; }
function te () { cd $MY_MW/extensions/Translate; }
function twn () { cd ~/devel/translatewiki; }
function ulsx () { cd $MY_MW/extensions/UniversalLanguageSelector; }
function cx () { cd $MY_MW/extensions/ContentTranslation; }
function cldr () { cd $MY_MW/extensions/cldr; }
function ldata () { cd ~/devel/language-data; }
function uls () { cd ~/devel/jquery.uls; }
function ime () { cd ~/devel/jquery.ime; }
function i18n () { cd ~/devel/jquery.i18n; }
function core () { cd $MY_MW/; }
function mint () { cd ~/devel/machinetranslation; }
function ve () { cd $MY_MW/extensions/VisualEditor; }
function pshs () { python3 -m http.server; }