#4341 problem with GIT cgi wrapper: git-rev-parse not found!?

Steven Page

Hey guys!

Not sure if this is a bug or not, but I am having problems getting started with the GIT module for Virtualmin-

It seems that there are lines in the CGI wrapper mechanism that are calling something along the lines of: "$gitbin/git-cat-file (for example), or git-rev-parse;

anyways, i have both git, and gitweb installed from the official repository (ubuntu 12.04), and have also tried a basic make / install of the latest version from source, and

whereis git-rev-parse (for example)

only returns a reference to a man page. upon further investigation, i found that the same command was available from the git binary, supplied the flag like so: "git rev-parse"

i noticed that the only time i could find any executable by the actual name "git-rev-parse" (again, for example, -) was in reference to binaries in the windows build of GIT:

the topic in which i noticed this was https://groups.google.com/forum/#!topic/msysgit/VrQLAgQwJHM

i also did find these commands compiled to binary in the folder which git was compiled to, but it did not actually install these binaries, and the command was only available from the command line as "git rev-parse", and not "git-rev-parse"

is this likely a problem with my configuration, OS, or Platform, or am i simply just missing something here..?

hope to get some insight, and if the binary naming convention has changed, i will attempt to make a modification of the template in which the cgi wrapper is built from, and will report my success...

thanks very much guys! hope this wasn't too much info!


  • Steven Page

    Steven Page - 2014-01-12

    turns out that the binaries i was looking for can be found in the package: git-core, and under the proper directory /usr/lib/git-core...

    this allowed me to gain access to the project directory using the virtualmin Git interface. however, there are more problems.... sigh

    here is some of my error log reported by the fcgi process;

    gitweb.cgi: Use of uninitialized value $epoch in gmtime at gitweb.cgi line 813., referer: https://website.com/git/gitweb.cgi?p=ispman.git;a=commit;h=

    gitweb.cgi: Use of uninitialized value $epoch in addition (+) at gitweb.cgi line 823.,

    gitweb.cgi: Use of uninitialized value $head in concatenation (.) or string at gitweb.cgi line 129.,

    gitweb.cgi: Use of uninitialized value $head in concatenation (.) or string at gitweb.cgi line 130.,

    what i extracted from the actual error reported on the page:

    403 Forbidden - Invalid hash parameter.

    403 Forbidden - Reading tree failed.


    anyways, any ideas if this is a bug of is there still some magic needed to get this running properly?


  • Steven Page

    Steven Page - 2014-01-13


    okay so, after some hard work, i figured out a solution to my problems.

    first, the solutions was to follow the steps outlined by lulatsch66 in this post: http://www.virtualmin.com/node/29267#comment-122634

    Next, the Gitweb wrapper used by virtualmin seems to be possibly out of date;

    Considering if gitweb was installed from the repository, the solution to fix gitweb.cgi was to copy the repository installed gitweb.cgi, including dependencies (files under ./static in the gitweb template directory) to the users ./git directory, fix permissions (both on the filesystem, and in the users .htaccess), and edit the cgi wrapper within respect to the changes normally made by virtualmin (specify repository path, etc)

    after this, some final changes would be to edit /etc/gitweb.conf and comment out the project path directive, in order to always load this from the users configuration

    note: on the client side (Windows), i also experience a problem with pushing anything to the repository. along side the suggested .netrc fix, it seems that sometimes there is a dependency issues, and libcurl-4.dll was missing, or was the wrong version. the solution for this is to add git to the PATH directive. if this does not help, try copying libcurl.dll to System32. you may also be able to simply rename libcurl.dll to libcurl-4.dll to in the git bin directory.

    hope that this helps somebody! this post is a duplicate from the forum, intended to help get git working out of the box again!

    Thanks for all the hard work guys!

    Last edit: Steven Page 2014-01-13
  • Jamie Cameron

    Jamie Cameron - 2014-01-13

    Thanks for the bug report - this does indeed sound the same as the Virtualmin Git bug you linked to, which will be fixed in the next release.

  • Steven Page

    Steven Page - 2014-01-13

    any time! and thank you for the great product, once again!

    it should be noted though, it turns out that the updated and working CGI wrapper from gitweb,

    the path to the Git binary is indeed working as expected, but only once you upgrade to the latest version of the wrapper...

    i had changed it to /usr/lib/git-core, as discussed in the referenced post, but had to change it back to the git executable once the upgrade was complete-

    besides that, my previous post outlines just how i got it working.

    thank you very much for possibly addressing this in the next release :)


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks