Github Group
Ryan Schmidt
ryandesign at macports.org
Wed Jan 16 17:25:53 PST 2013
On Jan 16, 2013, at 19:04, Sean Farley wrote:
> On Wed, Jan 16, 2013 at 4:17 PM, Ryan Schmidt wrote:
>>
>> On Jan 16, 2013, at 14:17, Sean Farley wrote:
>>
>>> I think it'll suffice to check for a tarball download + an empty tag
>>> prefix + len(version) > 12. A hash can be looked up at any length as
>>> long as it's match is unique, therefore the length of 12 is a soft
>>> requirement. I didn't pull it out of thin air, though; it's from an
>>> early version of git / mercurial of making 12 a lower bound until
>>> better algorithms arose.
>>
>> I believe the committish should always be specified in full, with all 40 characters, to prevent overlap with possible future commits.
>
> The problem with this is that some sites (bitbucket) only specify 12
> characters. I believe 12 is enough to provide uniques prefixes for a
> SHA1 hash for up to 16^12 commits. My gut reaction is to go for 12 but
> I don't feel strongly one way or the either.
git hashes are sha1 checksums, which are 40-character strings. Substrings of those might be suitably unique if a project doesn't have terribly many commits, but I'm not a cryptography expert and wouldn't want to chance it. It only takes a few clicks to get the full 40-character hash from github (or presumably from the git command line), and the github portgroup isn't for bitbucket or any other service.
>> The check should not include an empty tag prefix; there's no reason why you couldn't have a tag prefix, to check if and when a future stable version is tagged.
>
> Then how would be test the if-statement to determine checking the rss
> feed or scrapping the tags page?
That... is a good question.
Ok, how's this: there could be a new portgroup option github.livecheck_type which would default to "commits" if github.version matches ^[0-9a-f]{9,}$ and github.tag_prefix is empty, or "tags" otherwise. And livecheck.url and livecheck.regex would be set based on github.livecheck_type. So the default github.livecheck_type would suit most uses, and could still be overridden if necessary.
>> The check on github.version should include the regex ^[0-9a-f]+$
>
> Oh. Are you suggesting that we always use the committish? Or do you
> mean that the check should only be len(github.version) > 8 && regex
> ^[0-9a-f]+$ matches?
More information about the macports-dev
mailing list