pedroborges / kirby-autogit

⬢ Saves every change made via Kirby Panel to a Git repository
149 stars 23 forks source link

Use commit authors as committers, too #53

Open mfrischknecht opened 5 years ago

mfrischknecht commented 5 years ago

I'm trying to use kirby-autogit on a Webfaction server. For some strange reason, commits issued by kirby-autogit fail with Git's "Tell me who you are!" message, although my global git config contains user.name and user.email entries and php is run with the correct user.

Since I couldn't figure out how to fix this situation and I can imagine that my environment is not the only one suffering from such issues, I figured it's probably easier to make kirby-autogit robust against the problem by using the author also as the committer.

The committer name and email are provided using -c user.name=%s and -c user.email=%s in front of the commit command and thus don't rely on any modifications of git config files.

mfrischknecht commented 5 years ago

By the way, since I already have the opportunity here: Thank you very much for this great plugin! :smiley:

mfrischknecht commented 5 years ago

Also, on another note:

For some strange reason, commits issued by kirby-autogit fail with Git's "Tell me who you are!" message [...]

Sadly, the failure also isn't visible in the panel; whenever I change a file and the error occurs, the notification in the top right still displays a green smiley. To find the error (an exception is thrown in $this->commit(...)), I had to build in a try ... catch statement and log the exception out into a file myself. I don't know much about plugin development for Kirby myself though, so I don't know if there is a good error channel for this.