I don't think we need to go the full 40 chars.

It is highly unlikely people are going to use 10 hex chars
as a tag (and if they do, it's likely it's just a copy of the
commit hash)

10 seems like a good number. tb@ mentionned that 8 is too short
(we already ran into collision with 8).

So 10 ? or 12 ?

Opinions ?

Index: dist-tuple.port.mk
===================================================================
RCS file: /cvs/ports/infrastructure/mk/dist-tuple.port.mk,v
diff -u -p -r1.14 dist-tuple.port.mk
--- dist-tuple.port.mk  28 Sep 2023 06:02:43 -0000      1.14
+++ dist-tuple.port.mk  5 Nov 2023 19:06:56 -0000
@@ -25,7 +25,7 @@ ERRORS += "Fatal: invalid choice for DIS
 .    endif
 
 _subdir =
-.    if "${_id}" == "HASH" || "${_id:C/^[0-9a-f]{40}$/HASH/}" != "HASH"
+.    if "${_id}" == "HASH" || "${_id:C/^[0-9a-f]{10,40}$/HASH/}" != "HASH"
 # set DISTNAME if not done by the port and add refs/tags/ subdir
 DISTNAME ?= ${_project}-${_id:C/^(v|V|ver|[Rr]el|[Rr]elease)[-._]?([0-9])/\2/}
 _subdir =      refs/tags/

Reply via email to