At the moment I'm writing up one of my regular development update posts on the Numbas blog. I try to write one every couple of months. The posts act as a changelog for the various projects related to Numbas.
It's been just over seven months since the last one, because of everything, so this time there's a lot to talk about.
The way I normally do this is to go to GitHub and scroll through the commit log for the Numbas runtime and editor repositories, adding a bullet point for each bug fix or new feature, linking to either the relevant commit, an entry in the issue tracker, or a documentation page.
GitHub has a way of showing you just the commits in a certain range, but it's hard to find. I can't remember how I found it originally - maybe it's linked when you're setting up a pull request or trying to merge a branch into the main one - but I always have to look it up again when I start writing one of these posts.
The URL format is
You'd think that
RANGE is the same syntax that the git command-line tool uses for specifying ranges, but it's subtly differnt.
a..b represents the range between references
b in the git command-line.
GitHub understands this, but shows you file diffs between those two points instead of a list of commits.
You can get it to show you a list of commits by using three dots:
I thought this was a weirdly obscure syntax!
git log A..Bmeans "show me commits that are in B but not in A".
git log A...Bmeans "show me commits that are in one of A,B but not both". (So it shows you all the commits on a minimal path joining A and B.)
git diff A..Bmeans "show me the differences between A and B".
git diff A...Bmeans "show me the differences between (last common ancestor of A,B) and B".
So that's annoying!
Anyway, this is what I've been doing for a few years. Since development on the Numbas LTI tool picked up, I had a third repository to check. And there are separate repositories for each of the extensions to Numbas, and I haven't been in the habit of tagging release numbers for those so I have to just look at the whole commit history.
Today I decided my life would be a lot easier if I could get a list of all the commits in any repository belonging to the numbas organisation since the date of the last blog post.
I asked on mathstodon if this is possible. Mike Sheldon replied with this URL:
This shows the latest commits in any repository belonging to
YOUR_ORG, most recent first.
There are only 8 commits per page, which isn't many.
I can't work out how to get to this query without just pasting the URL into my browser: just putting
org:numbas in the search box redirects to the organisation's homepage, skipping the search page.
I spent a few minutes putting together a script to fetch these search results in JSON format so I could see all of them in a single table, and then @firstname.lastname@example.org suggested writing a script to do it with the git command-line tool.
This makes a lot of sense!
I have all the git repositories, under a
numbas directory, so I just need to write a script that runs
git log in each directory and then collate the commits.
It produces a table like this:
|update JME function hints
|def.ignore is an observable!
|move loadVariables from SCORMStorage to BlankStorage
|in the extension part type's Testing tab, render the prompt
|docs: add an anchor above the pipe operator's documentation
|fix a typo
That's exactly what I need!
I hope it's useful to somebody else, too.
Well, I wanted to do a Numbas development update again, and was sure I'd written a script to find recent commits, but couldn't find it. So I wrote the script again, as a command-line tool this time.
And then I found this post.
And then I smacked my head.
So I might as well share the command-line script.