Open knut-forkalsrud opened 6 years ago
Would love to see this added! Is it also possible to have the commitMessage
be something you can append or change via the config? Maybe something like this:
protected function commitMessage() {
$msg = $this->label();
if ($this->user) {
$msg .= ' by ' . $this->user->username();
}
// Append commit if in config
if ($commitAppend = array_get($this->config, 'git_commit_append')) {
$msg .= ' ' . $commitAppend;
}
return $msg;
}
Git distinguishes between author and committer. The configured committer details in
site/settings/addons/spock.yaml
are fine, but the Statamic user who is logged in should be credited with the authorship. The log show both. For example withspock.yaml
like the example:And a user (username "bob", first name "Bob", last name "Author", email "bob@example.com"). The log will look something like:
This is somewhat opposite to the desires expressed in issue #25, having the commit message itself include something like "[spock]" to distinguish it from typical developer commits. However there is no conflict between this and that. We can do both.
My apologies for breaking all the tests. I'm not really a PHP developer, and my feeble attempt at running the test is greeted with a definite error message:
I may need a pointer to how to run the tests effectively.
Also part of the pull request is a change from looking at "affected paths", and instead commit all outstanding changes. There seems to be an issue with some changes (draft blog entries) not being accurately reflected in "affected paths". Maybe this aspect should have ben a different pull request altogether.
Finally I'm using the standard
escapeshellarg
to escape any potential malicious input to the shell command. I notice commit b4a89a4c7cff3ef5ff6da35471d6507182f65076 is opposite in some ways, but I suspect that is just a workaround for a different culprit.