To find all the commits for a particular MDL, you can use a git command like this:
I am going to assume you have a git checkout somewhere. If necessary, do this one-time setup:
git remote add upstream https://github.com/moodle/moodle.git
git fetch upstream
(That URL in the first command comes from the 'Code' button at https://github.com/moodle/moodle/.) Then, when you want to find a particular commit
git fetch upstream
git log --grep MDL-12345 upstream/MOODLE_401_STABLE
(The repeated fetch is just to ensure everythign is up to date.) Here, MDL-12345 is the issue you care about, and MOODLE_401_STABLE is branch you want commits from. Ignore any merge commits (which you could do by adding --no-merges to the command-line, but it can be good to see all the history.)