Lines Matching +full:commit +full:- +full:message
6 * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html
42 $this->temp_dir = GitBackedUtil::getTempDir();
47 $controller->register_hook('IO_WIKIPAGE_WRITE', 'AFTER', $this, 'handleIOWikiPageWrite');
48 $controller->register_hook('MEDIA_UPLOAD_FINISH', 'AFTER', $this, 'handleMediaUpload');
49 $controller->register_hook('MEDIA_DELETE_FILE', 'AFTER', $this, 'handleMediaDeletion');
50 $controller->register_hook('DOKUWIKI_DONE', 'AFTER', $this, 'handlePeriodicPull');
56 $repoPath = GitBackedUtil::getEffectivePath($this->getConf('repoPath'));
57 $gitPath = trim($this->getConf('gitPath'));
65 $repoWorkDir = $this->getConf('repoWorkDir');
70 : Git::getBin() . ' --work-tree ' . escapeshellarg($repoWorkDir));
73 [$this->getAuthorMail(), $this->getAuthor()],
74 $this->getConf('addParams')
85 $ignorePaths = trim($this->getConf('ignorePaths'));
97 private function commitFile($filePath, $message) argument
99 if (!$this->isIgnored($filePath)) {
100 $message = str_replace(
102 [$this->getAuthor(), $this->getAuthorMail(), "\n"],
103 $message
107 $repo = $this->initRepo();
109 //add the changed file and set the commit message
110 $repo->add($filePath);
111 $repo->commit($message);
113 //if the push after Commit option is set we push the active branch to origin
114 if ($this->getConf('pushAfterCommit')) {
115 $repo->push('origin', $repo->activeBranch());
118 if (!$this->isNotifyByEmailOnGitCommandError()) {
119 … throw new Exception('Git committing or pushing failed: ' . $e->getMessage(), 1, $e);
133 return $this->getUserInfo('name');
138 return $this->getUserInfo('mail');
144 …$repoPath = str_replace('\\', '/', realpath(GitBackedUtil::getEffectivePath($this->getConf('repoPa…
157 $success = $Indexer->addPage($page, false, false);
161 // Failed to index the page. Your DokuWiki is older than release 2011-05-25 "Rincewind"
170 if ($this->getConf('periodicPull')) {
171 $enableIndexUpdate = $this->getConf('updateIndexOnPull');
172 $lastPullFile = $this->temp_dir . '/lastpull.txt';
180 $timeToWait = $this->getConf('periodicMinutes') * 60;
186 $repo = $this->initRepo();
188 $localPath = $this->computeLocalPath();
191 $revBefore = $repo->run('rev-parse HEAD');
195 $repo->pull('origin', $repo->activeBranch());
199 $revAfter = $repo->run('rev-parse HEAD');
203 … $changedFilesPage = $repo->run('diff --name-only ' . $revBefore . ' ' . $revAfter);
210 … // for example: local/path/dir/subdir/test.txt -> dir:subdir:test
211 // -4 removes .txt
212 … $page = str_replace('/', ':', substr($cf, strlen($localPath) + 1, -4));
215 $this->updatePage($page);
223 if (!$this->isNotifyByEmailOnGitCommandError()) {
224 … throw new Exception('Git command failed to perform periodic pull: ' . $e->getMessage(), 2, $e);
237 $mediaPath = $event->data['path'];
238 $mediaName = $event->data['name'];
240 $message = str_replace(
243 $this->getConf('commitMediaMsgDel')
246 $this->commitFile($mediaPath, $message);
252 $mediaPath = $event->data[1];
253 $mediaName = $event->data[2];
255 $message = str_replace(
258 $this->getConf('commitMediaMsg')
261 $this->commitFile($mediaPath, $message);
267 $rev = $event->data[3];
274 $pagePath = $event->data[0][0];
275 $pageName = $event->data[2];
276 $pageNs = $event->data[1];
277 $pageContent = $event->data[0][1];
281 $editSummary = $GLOBALS['INPUT']->str('summary');
285 // get the commit text for deletions
286 $msgTemplate = $this->getConf('commitPageMsgDel');
293 //get the commit text for edits
294 $msgTemplate = $this->getConf('commitPageMsg');
297 $message = str_replace(
303 $this->commitFile($pagePath, $message);
314 * @param string error message
324 …return $this->notifyByMail('mail_create_new_error_subject', 'mail_create_new_error', $template_rep…
332 * @param string error message
341 …return $this->notifyByMail('mail_repo_path_error_subject', 'mail_repo_path_error', $template_repla…
352 * @param string error message
364 …return $this->notifyByMail('mail_command_error_subject', 'mail_command_error', $template_replaceme…
378 if (!$this->getConf('notifyByMailOnSuccess')) {
386 …return $this->notifyByMail('mail_command_success_subject', 'mail_command_success', $template_repla…
401 //dbglog("GitBacked - notifyByMail: [subject_id=" . $subject_id
404 if (!$this->isNotifyByEmailOnGitCommandError()) {
407 …//$template_text = rawLocale($template_id); // this works for core artifacts only - not for plugins
408 $template_filename = $this->localFN($template_id);
410 $template_html = $this->render_text($template_text);
413 $mailer->to($this->getEmailAddressOnErrorConfigured());
414 //dbglog("GitBacked - lang check['".$subject_id."']: ".$this->getLang($subject_id));
415 //dbglog("GitBacked - template text['".$template_id."']: ".$template_text);
416 //dbglog("GitBacked - template html['".$template_id."']: ".$template_html);
417 $mailer->subject($this->getLang($subject_id));
418 $mailer->setBody($template_text, $template_replacements, null, $template_html);
420 $ret = $mailer->send();
433 $emailAddressOnError = $this->getEmailAddressOnErrorConfigured();
445 $emailAddressOnError = trim($this->getConf('emailAddressOnError'));