Jump to content

User:TheresNoTime/Dev notes

From mediawiki.org

A collection of things I always forget but often need.

TIL

[edit]

Node

[edit]
  • MediaWiki is tested using node 18.

Misc

[edit]

I want to..

[edit]

Rebase a Gerrit changeset

[edit]

From the guide:

# First download the current change set
$ git-review -d 424242
# Next make sure you have a fresh copy of the target branch ("main" in this case)
$ git fetch origin main
# Then rebase your change and fix any conflicts that may occur
$ git rebase -i origin/main

Pull a wmf.N branch

[edit]

Should just be (e.g.) git checkout wmf/1.44.0-wmf.8 but if that doesn't work (maybe error: pathspec 'wmf/1.44.0-wmf.8' did not match any file(s) known to git), check .git/config for fetch = +refs/heads/*:refs/remotes/origin/*

Front-end

[edit]

I want to..

[edit]

Get the full URL to a Title

[edit]

Use mw.util.getUrl (docs):

const log_id = 1000;
console.log(
  mw.util.getUrl(
    'Special:Log',  // The page
    {
      logid: log_id  // Array of params
    }
  )
);

returns /w/index.php?title=Special:Log&logid=1000