protected function run(\DialoGit\Dialoger $dialoger) { $picker = new \DialoGit\Picker\Stash($dialoger); $stash = $picker->pickOne('Pick one stash to <b>apply</b>:'); $dialoger->dialogConfirm('Are you sure that you wish to <b>apply</b> this stash?\\n\\n' . $stash); $dialoger->runGit('stash apply "' . $stash . '"'); }
protected function run(\DialoGit\Dialoger $dialoger) { $params = new \DialoGit\ScriptParams(); $files = $params->requireSelectedFiles(); $quotedFiles = $params->requireSelectedFilesQuoted(); $fileFiles = count($files) == 1 ? 'this file' : 'these files'; $dialoger->dialogConfirm('Do you wish to <b>remove</b> ' . $fileFiles . ' from the <b>git repository</b> and from the <b>disk</b> for sure?\\n\\n' . addslashes(implode('\\n', $files))); $dialoger->runGit('rm -r -f ' . implode(' ', $quotedFiles)); }
protected function run(\DialoGit\Dialoger $dialoger) { $params = new \DialoGit\ScriptParams(); $files = $params->requireSelectedFiles(); $quotedFiles = $params->requireSelectedFilesQuoted(); $thisThese = count($files) == 1 ? 'this file' : 'these files'; $dialoger->dialogConfirm('Are you sure you want to <b>delete</b> the <b>staged changes</b> for ' . $thisThese . '?\\n\\n' . addslashes(implode('\\n', $files))); $dialoger->runGit('checkout -- ' . implode(' ', $quotedFiles)); }
protected function run(\DialoGit\Dialoger $dialoger) { $picker = new \DialoGit\Picker\Remote($dialoger); $remotes = $picker->pickMany('Select one or more remote repositories to <b>remove</b>:'); $thisThese = count($remotes) == 1 ? 'this remote repository' : 'these remote repositories'; $dialoger->dialogConfirm('Do you wish to <b>remove</b> ' . $thisThese . ' for sure?\\n\\n' . implode("\n", $remotes)); foreach ($remotes as $remote) { $dialoger->runGit('remote remove ' . $remote); } }
protected function run(\DialoGit\Dialoger $dialoger) { $picker = new \DialoGit\Picker\Stash($dialoger); $stashes = $picker->pickMany('Pick one or more stashes to <b>drop</b>:'); $thisThese = count($stashes) == 1 ? 'this stash' : 'these stashes'; $dialoger->dialogConfirm('Do you wish to <b>drop</b> ' . $thisThese . ' for sure?\\n\\n' . implode("\n", $stashes)); foreach ($stashes as $stash) { $dialoger->runGit('stash drop "' . $stash . '"'); } }
protected function run(\DialoGit\Dialoger $dialoger) { $picker = new \DialoGit\Picker\Branch($dialoger); $branches = $picker->getStructures(); if (count($branches) == 1) { $dialoger->dialogError('There is only one local branch right now.'); $dialoger->error(); } $currentBranch = $picker->getCurrent(); $branches = $picker->pickManyBut('HEAD is on <b>' . $currentBranch . '</b>\\n\\nPick one or more local branches to <b>delete</b>:', $currentBranch); $thisThese = count($branches) == 1 ? 'this local branch' : 'these local branches'; $dialoger->dialogConfirm('Do you wish to <b>delete</b> ' . $thisThese . ' for sure?\\n\\n' . implode("\n", $branches)); foreach ($branches as $branch) { $dialoger->runGit('branch -d ' . $branch); } }
protected function run(\DialoGit\Dialoger $dialoger) { $picker = new \DialoGit\Picker\Branch($dialoger); $branches = $picker->getStructures(); if (count($branches) == 1) { $dialoger->dialogError('There is only one local branch right now.'); $dialoger->error(); } $currentBranch = $picker->getCurrent(); if ($picker->isHeadOnBranch()) { $branch = $picker->pickOneBut('HEAD is on <b>' . $currentBranch . '</b>\\n\\nPick one local branch to <b>merge</b> with:', $currentBranch); $dialoger->dialogConfirm('Do you want to modify <b>' . $currentBranch . '</b> by merging the contents of <b>' . $branch . '</b> into it?'); $dialoger->runGit('merge ' . $branch); } else { $dialoger->dialogError('Merge requires HEAD to be on a branch, but HEAD is on <b>' . $currentBranch . '</b>, which is not a branch.'); $dialoger->error(); } }
protected function run(\DialoGit\Dialoger $dialoger) { $repositoryDir = $this->params->getGitRepositoryBaseDir(); $dialoger->dialogConfirm('Are you sure you want to <b>delete</b> the <b>staged changes</b> for the Git repository base directory?\\n\\n' . $repositoryDir); $dialoger->runGit('checkout -- ' . $repositoryDir); }
protected function run(\DialoGit\Dialoger $dialoger) { $dialoger->dialogConfirm('Are you sure you want to <b>delete</b> the <b>staged changes</b> for this directory?\\n\\n' . $this->params->getWorkingDir()); $dialoger->runGit('checkout -- .'); }