Guido Günther <a...@sigxcpu.org> writes: > On Tue, Apr 16, 2013 at 10:34:14AM +0300, Markus Lehtonen wrote: > [..snip..] >> >[replacements] >> >last_upstream = ... >> >foo = cmd1 >> >bar = cmd2 >> > >> >Im undecided if the rhs should be evaluated by a shell or by python but >> >we probably want both. >> >> Hmm, I dislike the idea of running arbitrary shell (or Python) code from >> the command line. How about just allowing few git commands (through >> gbp.git) and python regex or something. > > We could have all of them off by default. I'm not 100% sure we need this > either especially since Daniel's use case doesn't need arbitrary python > code but just some additional command line options but if it's > implemented consistently (and can be turned off easily) I have no > objections in merging it.
Hello, I'm not sure about making it configurable, but that's probably because I can't find use case for it. The %(since)s and %(last_upstream)s require calculation far too complicated for a single command and looks relevant only for git-dch. I don't find a good way to derived a class from string and fill all the values. Only replacements defined in the configuration could be filled after options parsing. For example, the %(version)s means sometime the debian version, sometime the upstream one, and is set: - from command line - from origin tarball - from gbp.deb.DscFile - from DebianGitRepository.debian_version_from_upstream, called by gbp.scripts.dch.guess_version_from_upstream - from debian/changelog Overriding the “.format()” method does not exclude the need to pass some replacement values only relevant for some command to some options and only after some calculation. Regards. -- Daniel Dehennin Récupérer ma clef GPG: gpg --keyserver pgp.mit.edu --recv-keys 0x7A6FE2DF
pgp3GBrxWHY4w.pgp
Description: PGP signature