Exemplo n.º 1
0
 /**
  * Adds the needed options to the GitLogCommand object to retrive the right information.
  * Calls the executeShellCommand to execute the built command.
  *
  * @param GitLogCommand $gitLogCommandObject
  */
 private function createLogFile(GitLogCommand $gitLogCommandObject)
 {
     $gitLogFormat = new GitLogFormat();
     $gitLogFormat->setSeparator($this->gitLogFileHandler->getSeparator())->setPrefix($this->gitLogFileHandler->getPrefix())->setSuffix($this->gitLogFileHandler->getSuffix())->addPlaceholderAbbreviatedCommitHash()->addPlaceholderAuthorName()->addPlaceholderCommitterDateUnixTimestamp()->addPlaceholderSubject()->addPlaceholderBody();
     $gitLogCommandObject->addOptionPrettyFormat($gitLogFormat);
     $gitLogCommandObject->addOptionNameStatus();
     $shellCommand = "cd " . $this->localRepository . "; " . $gitLogCommandObject->getCommandToString() . " > " . $this->gitLogFileHandler->getFilePath();
     $this->executeShellCommand($shellCommand);
     $this->gitLogFileHandler->setUsedOptionsList($gitLogFormat->getOptionsList());
 }
Exemplo n.º 2
0
 /**
  * Adds the option '--pretty=farmat:<format_expression> ' at he end of option_list.
  * <format_expression> is set using an instance of GitLogFormat class.
  *
  * @param GitLogFormat $gitLogFormat
  */
 public function addOptionPrettyFormat(GitLogFormat $gitLogFormat)
 {
     $this->option_list .= "--pretty=format:" . $gitLogFormat->getLogFormat() . " ";
 }