The difference is that root directory of tarball is named
${GH_ACCOUNT}-${GH_PROJECT}-${GH_COMMIT} in the first case and
${GH_PROJECT}-${GH_TAGNAME} in the second one.

The second scheme is more convenient, as it doesn't require maintainer to retrieve and specify commit hash.

I propose to make use of the new scheme while leaving support for the old one. To select scheme, GH_COMMIT is checked. If it's defined, the old scheme is used. If not, the new one. Since GH_COMMIT is mandatory in the old scheme, this change is fully backwards compatible. Now, ports may just omit GH_COMMIT to use the new scheme.

It turns out that we now allow redirects just fine, so I see no point for not using official public URL. The change should be trivial and not affect any ports.

Also, do we really need ${GH_ACCOUNT} at the beginning of ${DISTNAME}? This makes port and distfile matching harder for user. I'd go with ${PORTNAME}-${PORTVERSION}-${GH_ACCOUNT}_${GH_TAGNAME} or similar.

Multiple reasons. 1. The API link redirects to the LEGACY url. Which invalidates your entire change pointless. 2. Using the main site URL just redirects to codeload anyhow but it ends up expanding whatever tag/hash you give until the full name. So we can no longer use a 4 char hash or 8 char hash, it forces the full hash length. It is an inconvenience for porters and would not allow a simple old->new USE_GITHUB transition as porters would have to go lookup the full hash, which Github tends to hide from you. The API URL issue is discussed in Bug 194898.