Bug#1009163: import-orig: please make --upstream-vcs-tag=%(version)s strip +dfsg/+ds repack suffixes

2023-05-01 Thread Guido Günther
Hi Guilhem,
On Mon, Mar 06, 2023 at 01:37:01PM +0100, Guilhem Moulin wrote:
> Hi Guido,
> 
> On Wed, 01 Mar 2023 at 12:14:51 +0100, Guido Günther wrote:
> > On Tue, Aug 09, 2022 at 01:07:34PM +0200, Guilhem Moulin wrote:
> >> 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.
> 
> That would cover my use-case nicely, at least :-)

Sorry for the delay. I've pushed something based on the patch in
#968329. Maybe we can even get away without another option this way.
Cheers,
 -- Guido

> 
> -- 
> Guilhem.



Bug#1009163: import-orig: please make --upstream-vcs-tag=%(version)s strip +dfsg/+ds repack suffixes

2023-03-06 Thread Guilhem Moulin
Hi Guido,

On Wed, 01 Mar 2023 at 12:14:51 +0100, Guido Günther wrote:
> On Tue, Aug 09, 2022 at 01:07:34PM +0200, Guilhem Moulin wrote:
>> 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.

That would cover my use-case nicely, at least :-)

-- 
Guilhem.


signature.asc
Description: PGP signature


Bug#1009163: import-orig: please make --upstream-vcs-tag=%(version)s strip +dfsg/+ds repack suffixes

2023-03-01 Thread Guido Günther
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.



Bug#1009163: import-orig: please make --upstream-vcs-tag=%(version)s strip +dfsg/+ds repack suffixes

2022-08-09 Thread Guilhem Moulin
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*)?$'
 - 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.


signature.asc
Description: PGP signature


Bug#1009163: import-orig: please make --upstream-vcs-tag=%(version)s strip +dfsg/+ds repack suffixes

2022-08-09 Thread Guido Günther
Hi,
On Fri, Apr 08, 2022 at 02:10:28AM +0200, Guilhem Moulin wrote:
> Package: git-buildpackage
> Version: 0.9.25
> Severity: wishlist
> 
> Dear Maintainer,
> 
> `gpg import-orig --upstream-vcs-tag=%(version)s` is great, however the
> substitution doesn't work well will repack suffixes such as +dfsg or
> +ds.  Perhaps ‘%(version)s’ shouldn't unconditionally strip repack
> suffixes, but unfortunately ‘%(version%+ds%)s’ doesn't work either
> 
>   >>> DebianGitRepository.version_to_tag(r'%(version%+ds%)s', "1.2.3+ds")
>   […]
> gbp.errors.GbpError: Failed to format %(version%+ds%)s: Missing value 
> 'version%+ds%' in {'version': '1.2.3+ds', 'hversion': '1-2-3+ds'}
> 
> AFAIK one can't use d/gbp.conf, instead one needs to manually run `gpg
> import-orig --upstream-vcs-tag=1.2.3 --uscan` which requires to find out
> the most recent upstream version number beforehand.  It would be nice if
> d/gbp.conf had a way to specify a substitution string or template that
> works with repack suffixes.

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.

Cheers,
 -- Guido



> 
> Thanks for maintaining gbp!
> -- 
> Guilhem.



Bug#1009163: import-orig: please make --upstream-vcs-tag=%(version)s strip +dfsg/+ds repack suffixes

2022-06-30 Thread Luca Boccassi
On Fri, 8 Apr 2022 02:10:28 +0200 Guilhem Moulin 
wrote:
> Package: git-buildpackage
> Version: 0.9.25
> Severity: wishlist
> 
> Dear Maintainer,
> 
> `gpg import-orig --upstream-vcs-tag=%(version)s` is great, however
the
> substitution doesn't work well will repack suffixes such as +dfsg or
> +ds.  Perhaps ‘%(version)s’ shouldn't unconditionally strip repack
> suffixes, but unfortunately ‘%(version%+ds%)s’ doesn't work either
> 
>   >>> DebianGitRepository.version_to_tag(r'%(version%+ds%)s',
"1.2.3+ds")
>   […]
> gbp.errors.GbpError: Failed to format %(version%+ds%)s: Missing
value 'version%+ds%' in {'version': '1.2.3+ds', 'hversion': '1-2-3+ds'}
> 
> AFAIK one can't use d/gbp.conf, instead one needs to manually run
`gpg
> import-orig --upstream-vcs-tag=1.2.3 --uscan` which requires to find
out
> the most recent upstream version number beforehand.  It would be nice
if
> d/gbp.conf had a way to specify a substitution string or template
that
> works with repack suffixes.
> 
> Thanks for maintaining gbp!
> -- 
> Guilhem.

Any update on this? It makes using gbp when repacking with +ds or +dfsg
impossible, as you get a Lintian error when repacking without appending
a suffix.

-- 
Kind regards,
Luca Boccassi


signature.asc
Description: This is a digitally signed message part


Bug#1009163: import-orig: please make --upstream-vcs-tag=%(version)s strip +dfsg/+ds repack suffixes

2022-04-07 Thread Guilhem Moulin
Package: git-buildpackage
Version: 0.9.25
Severity: wishlist

Dear Maintainer,

`gpg import-orig --upstream-vcs-tag=%(version)s` is great, however the
substitution doesn't work well will repack suffixes such as +dfsg or
+ds.  Perhaps ‘%(version)s’ shouldn't unconditionally strip repack
suffixes, but unfortunately ‘%(version%+ds%)s’ doesn't work either

>>> DebianGitRepository.version_to_tag(r'%(version%+ds%)s', "1.2.3+ds")
[…]
gbp.errors.GbpError: Failed to format %(version%+ds%)s: Missing value 
'version%+ds%' in {'version': '1.2.3+ds', 'hversion': '1-2-3+ds'}

AFAIK one can't use d/gbp.conf, instead one needs to manually run `gpg
import-orig --upstream-vcs-tag=1.2.3 --uscan` which requires to find out
the most recent upstream version number beforehand.  It would be nice if
d/gbp.conf had a way to specify a substitution string or template that
works with repack suffixes.

Thanks for maintaining gbp!
-- 
Guilhem.


signature.asc
Description: PGP signature