Dear Monks

I am putting together an ajax web application and have decided to use Git behind the scenes.

Git::Wrapper seems the obvious choice but I am having some trouble when this is used through apache. E.g. if I run the following from the command line:

#!/usr/bin/perl use strict; use Git::Wrapper; my $git = Git::Wrapper->new('/path/to/repo'); my @log = $git->log; print "Content-type: text/html\n\n<!DOCTYPE html><html><body><ul>\n"; print "<li>id: ${\$log[0]->id}</li>\n"; print "<li>author: ${\$log[0]->author}</li>\n"; print "<li>date: ${\$log[0]->date}</li>\n"; print "<li>message: ${\$log[0]->message}</li>\n"; print "</ul></body></html>";

it works as expected delivering the web page to the terminal - however, when run in the browser it complains:

open3: exec of git version failed at /usr/local/share/perl5/Git/Wrappe +r.pm line 112.

Not a terribly informative error message! I've checked file permissions and am pretty sure these are not the issue. Beyond this I am stumped (the Git::Wrapper documentation does seem a little on the thin side).

Before I start wading through the module code to try and figure out what it is trying to do at the point when it falls over, I wondered if anyone had any experience of using Git::Wrapper with apache and could point me in the direction of what I need to do to get this to work?

Many thanks!


In reply to using Git::Wrapper with Apache by tomgracey

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.