Skip Menu |

This queue is for tickets about the Dist-Zilla-Plugin-Git CPAN distribution.

Report information
The Basics
Id: 85658
Status: rejected
Priority: 0/
Queue: Dist-Zilla-Plugin-Git

People
Owner: Nobody in particular
Requestors: ether [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: templating is done before parsing INI, rather than after
In [Git::Init] (and possibly other plugins), the .ini content is being read in as a single string, passed through the templater, and *then* parsed as INI content. This makes it impossible to embed special characters in the config values, as one might be able to by hiding them inside {{ }} blocks. Example profile.ini: [Git::Init] commit_message = initial commit, via [Git::Init]{{ "\n\n" }}in {{ $dist->name }}-{{ $dist->version }}. results in: Syntax error at line 55: 'in Dist-Zilla-PluginBundle-Author-ETHER-0.007. ' at /Users/ether/.perlbrew/libs/19.0@std/lib/perl5/Config/MVP/Reader/INI.pm line 21. The file should be parsed as an INI first, and then relevant attribute values should be templated separately.
I'm not sure what you're talking about. Git::Init doesn't support {{...}} style templates at all. When I try minting a dist using your example profile.ini, it works fine, but that string is used as the literal commit message. You must have some other plugin that's processing profile.ini as a template. The only special codes in commit_message are %n for a newline and %N for the distribution name. (It doesn't even support %v for version number, but it could probably be added if you need that.)
On 2013-06-07 22:45:26, CJM wrote: Show quoted text
> I'm not sure what you're talking about.
I think this is a case of PEBKAC. will respond with more details when I find a moment to decipher what actually happened!
On 2013-06-27 14:45:30, ETHER wrote: Show quoted text
> On 2013-06-07 22:45:26, CJM wrote:
> > I'm not sure what you're talking about.
> > I think this is a case of PEBKAC. will respond with more details when > I find a moment to decipher what actually happened!
Yep, I template profile.ini at (minting profile) build time, to insert the name and version of the distribution responsible for the minting. I can't find any notes regarding what I was trying to do at the time, but it seems like I was just trying to insert a few CRs into the commit message, which of course I can do simply with a %N, without having to embed {{ "\n\n" }} (which of course gets evaluated too soon, before profile.ini is parsed by Config::MVP, so it's no longer a valid option string). I have no justification for this sorry excuse of a bug report; closing.. sorry for the bother!