thathoff / kirby-git-content

Commit and Push changes made via the Panel
MIT License
135 stars 20 forks source link

error in staging : --max-count=10 #108

Open paubou opened 4 months ago

paubou commented 4 months ago

Getting this error on Kirby 4.2 : Command 'LC_ALL=C git log '--pretty=format:%H|%s|%an|%ae|%cI' '--max-count=10'' failed (exit-code -1).

It's working great locally, but as soon as I deploy to my staging env, it's giving me the error...

thathoff commented 4 months ago

Can you try to run the command on the server as the webserver’s user? Mostly this is related to an old git version on the server.

svenk commented 2 months ago

I got the same error message and in fact, it was the reason of a host OS (i.e. linux) user mismatch. The actual output which you only get on the command line invoking this command is then something like

fatal: detected dubious ownership in repository at '/home/foo/bar/baz'
To add an exception for this directory, call:

        git config --global --add safe.directory /home/foo/bar/baz

The solution is, as @thathoff said, to make sure that the .git directory is owned by the same system user who is running the PHP process (for instance www-data on a classical linux php-fpm or LAMP system).

It would be very good if the error message in the panel captured this stderr thrown by git so users get an idea what the actual error is. exit-code 128 is just telling nothing.