Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use commit authors as committers, too #53

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mfrischknecht
Copy link

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.

If `user.name` and `user.email` are not configured in the setup kirby-autogit is used in,
`$this->commit(...)` will fail, because git prints its infamous "tell me who you are"
message.

By explicitly providing the two config keys with each commit command,
we can use the determined user as the committer and thus have the commit
work anyway without needing any changes to any of git's configs.
@mfrischknecht
Copy link
Author

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

@mfrischknecht
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant