Hi,
On Tue, Aug 09, 2022 at 01:07:34PM +0200, Guilhem Moulin wrote:
> Hi Guido,
> 
> On Tue, 09 Aug 2022 at 10:54:54 +0200, Guido Günther wrote:
> > We could fix the replacement to be empty:
> > 
> > https://github.com/agx/git-buildpackage/compare/master...ds
> > 
> > This causes trouble for people though that need this *and* to mangle the
> > version by other means.
> 
> That'd work for me, thanks!  Some ideas to cover other use-cases if
> desired:
> 
>  - Always strip ‘+ds(\.\d*)?’ and ‘+dfsg(\.\d*)?’ repack suffixes
>    *after* version mangling.  After all, if upstream uses such suffixes
>    in its tags or version number, then the revision has to be mangled so
>    it doesn't collide with a repack suffix no?
>  - New option --upstream-vcs-tag-strip='\+ds(\.\d*)?$'

I wonder if a simple:

     --upstream-vcs-tag-strip

that defaults to 'on' would already do the trick (as stripping this
should be the norm (as you elaborate in your first point) and the option
is only there if people want the old behavior.

If that makes sense I'd be happy to apply a patch for this as I assume
this bits many pages that need to repack upstream tarballs *and* want
--upstream-vcs-tag

Cheers,
 -- Guido


>  - AFAIK substitution in tag formats currently support a single
>    character; it could be changed so the remaining of the middle portion
>    is stripped, so ‘%(version%.+ds%_)’ rewrites ‘1.2.3+ds’ to ‘1_2_3’
>    and ‘%(version%.+ds%.)’ rewrite it to ‘1.2.3’.  Odd semantics though
>    and not trivial to document…
> 
> cheers
> -- 
> Guilhem.

Reply via email to