Dealing with untagged projects on github

I currently make a package for an untagged project on Github. The only way (afaik) to fetch the source code is to get the following URL:
Code:
https://github.com/${USER}/${PROJECT}/archive/refs/heads/master.zip
So I add this section in my Makefile:

Makefile:
do-fetch:
    curl https://github.com/${USER}/${PROJECT}/archive/refs/heads/master.zip $(PORTNAME).zip


It works, but is there a preferred/better way to do this?
Regards
 

Code:
USE_GITHUB=	yes
GH_ACCOUNT= ${USER}
GH_PROJECT= ${PROJECT}
GH_TAGNAME= ${HASH}

Just use the hash of the last commit if it doesn't have a tag for it. This will consistently download the same state of the code. This is important for the distinfo file as that has a SHA checksum. Which would change if you download the master/main branch and new commits have been made to it. Set the version of your port to the ISO date, so you know at what point in time the port/package was created. This will also be consistent if you update it, set the version to the new date and the hash to the last commit on that date. See example 13 in the Porter's handbook.

[thread moved to "Porting new software"]
 
As SirDice says, you must pick something static. You can't just follow head for a port. The commit hash of the revision that you test against and that you make distinfo from is it.
 

Code:
USE_GITHUB=    yes
GH_ACCOUNT= ${USER}
GH_PROJECT= ${PROJECT}
GH_TAGNAME= ${HASH}

Just use the hash of the last commit if it doesn't have a tag for it. This will consistently download the same state of the code. This is important for the distinfo file as that has a SHA checksum. Which would change if you download the master/main branch and new commits have been made to it. Set the version of your port to the ISO date, so you know at what point in time the port/package was created. This will also be consistent if you update it, set the version to the new date and the hash to the last commit on that date. See example 13 in the Porter's handbook.

[thread moved to "Porting new software"]
Thanks to point me this example. I missed that DISTVERSION could be the date of the commit. Nice to see that "all" cases are targeted.
 
Back
Top