Lines Matching +full:delete +full:- +full:branch

9  * @version    0.1.1-a
18 // ------------------------------------------------------------------------
72 // ------------------------------------------------------------------------
87 return $this->repo_path;
95 $this->getConf('');
99 $repo->git_path = $git_exe_path;
123 $repo->clone_from($source);
124 else $repo->run('init');
141 $this->set_repo_path($repo_path, $create_new, $_init);
160 $this->repo_path = $repo_path;
163 $this->repo_path = $repo_path;
164 if ($_init) $this->run('init');
176 $this->repo_path = $repo_path;
177 if ($_init) $this->run('init');
179 throw new Exception('cannot create repository in non-existent directory');
200 $resource = proc_open($this->git_path, $descriptorspec, $pipes);
228 $resource = proc_open($command, $descriptorspec, $pipes, $this->repo_path);
252 $path = $this->git_path;
253 return $this->run_command($path." ".$command);
267 return $this->run("add $files -v");
277 return $this->run("log ".$revision." --reverse");
285 * @param string identifyer to id the branch/commit/position
288 public function getFile($filename, $branch = 'HEAD') { argument
290 $cmd = 'show '.$branch.':'.$filename;
293 return $this->run($cmd);
298 …Not really an exception, if a new page has been added the exception is part of normal operation :-(
314 if ($porcelain) return $this->run("status -u --porcelain");
315 return $this->run("status");
319 return $e->getMessage();
324 $status = $this->get_status(false);
325 $pos = strpos($status, 'Your branch is ahead of');
374 return $this->run("diff-tree -r --name-status --no-commit-id ".$hash);
389 $fullcmd = "cd \"".$this->repo_path."\" && ".$this->git_path." ".$cmd;
390 $this->run_command($fullcmd);
393 $fullcmd = "cd \"".$this->repo_path."\" && ".$this->git_path." ".$cmd;
394 $this->run_command($fullcmd);
396 $cmd = "add . -A";
397 $fullcmd = "cd \"".$this->repo_path."\" && ".$this->git_path." ".$cmd;
398 $this->run_command($fullcmd);
400 $cmd = "commit -a -m \"".$message."\"";
401 $fullcmd = "cd \"".$this->repo_path."\" && ".$this->git_path." ".$cmd;
402 $this->run_command($fullcmd);
407 msg($e->getMessage());
423 return $this->run("clone --local ".$this->repo_path." $target");
440 $cmd = "clone -q $source \"".$this->repo_path."\"";
441 $fullcmd = "cd \"".$this->repo_path."\" && ".$this->git_path." ".$cmd;
443 $this->run_command($fullcmd);
447 msg($e->getMessage());
462 return $this->run("clone $source ".$this->repo_path);
471 * @param bool delete directories?
475 return $this->run("clean".(($dirs) ? " -d" : ""));
479 * Runs a `git branch` call
481 * Accepts a name for the branch
484 * @param string branch name
487 public function create_branch($branch) { argument
488 return $this->run("branch $branch");
492 * Runs a `git branch -[d|D]` call
494 * Accepts a name for the branch
497 * @param string branch name
500 public function delete_branch($branch, $force = false) { argument
501 return $this->run("branch ".(($force) ? '-D' : '-d')." $branch");
505 * Runs a `git branch` call
508 * @param bool keep asterisk mark on active branch
512 $branchArray = explode("\n", $this->run("branch"));
513 foreach($branchArray as $i => &$branch) {
514 $branch = trim($branch);
516 $branch = str_replace("* ", "", $branch);
517 if ($branch == "")
524 * Returns name of active branch
527 * @param bool keep asterisk mark on branch name
531 $branchArray = $this->list_branches(true);
543 * Accepts a name for the branch
546 * @param string branch name
549 public function checkout($branch) { argument
550 return $this->run("checkout $branch");
557 * Accepts a name for the branch to be merged
560 * @param string $branch
563 public function merge($branch, $msg = "") argument
565 if ($msg == "") return $this->run("merge $branch --no-ff");
566 return $this->run("merge $branch --no-ff -m ".$msg);
579 return $this->run("reset --soft HEAD~1");
584 * Runs a git fetch on the current branch
591 return $this->run("fetch");
604 $this->run("fetch --dry-run");
628 return $this->run("tag -a $tag -m $message");
633 * Push specific branch to a remote
640 return $this->run($cmd);
644 * Pull specific branch from remote
646 * Accepts the name of the remote and local branch
649 * @param string $branch
652 public function pull($remote, $branch) argument
654 return $this->run("pull $remote $branch");
664 file_put_contents($this->repo_path."/.git/description", $new);
674 return file_get_contents($this->repo_path."/.git/description");