diff --git a/src/workflow/ArcanistDiffWorkflow.php b/src/workflow/ArcanistDiffWorkflow.php --- a/src/workflow/ArcanistDiffWorkflow.php +++ b/src/workflow/ArcanistDiffWorkflow.php @@ -218,10 +218,6 @@ 'help' => 'Attempt to convert non UTF-8 hunks into specified encoding.', ), - 'allow-untracked' => array( - 'help' => - 'Skip checks for untracked files in the working copy.', - ), 'excuse' => array( 'param' => 'excuse', 'help' => 'Provide a prepared in advance excuse for any lints/tests'. @@ -294,7 +290,7 @@ 'add-all' => array( 'short' => 'a', 'help' => - 'Automatically add all untracked, unstaged and uncommitted files to '. + 'Automatically add all unstaged and uncommitted files to '. 'the commit.', ), 'json' => array( diff --git a/src/workflow/ArcanistWorkflow.php b/src/workflow/ArcanistWorkflow.php --- a/src/workflow/ArcanistWorkflow.php +++ b/src/workflow/ArcanistWorkflow.php @@ -809,10 +809,6 @@ return $this->repositoryAPI; } - final protected function shouldRequireCleanUntrackedFiles() { - return empty($this->arguments['allow-untracked']); - } - final public function setCommitMode($mode) { $this->commitMode = $mode; return $this; @@ -875,13 +871,8 @@ // We only want files which are purely uncommitted. $uncommitted = array_diff($uncommitted, $unstaged); - $untracked = $api->getUntrackedChanges(); - if (!$this->shouldRequireCleanUntrackedFiles()) { - $untracked = array(); - } - $should_commit = false; - if ($untracked || $unstaged || $uncommitted) { + if ($unstaged || $uncommitted) { // NOTE: We're running this because it builds a cache and can take a // perceptible amount of time to arrive at an answer, but we don't want @@ -894,28 +885,6 @@ $lists = array(); - if ($untracked) { - if ($api instanceof ArcanistGitAPI) { - $hint = pht( - '(To ignore these %s change(s), add them to ".git/info/exclude".)', - new PhutilNumber(count($untracked))); - } else if ($api instanceof ArcanistSubversionAPI) { - $hint = pht( - '(To ignore these %s change(s), add them to "svn:ignore".)', - new PhutilNumber(count($untracked))); - } else if ($api instanceof ArcanistMercurialAPI) { - $hint = pht( - '(To ignore these %s change(s), add them to ".hgignore".)', - new PhutilNumber(count($untracked))); - } - - $untracked_list = " ".implode("\n ", $untracked); - $lists[] = pht( - " Untracked changes in working copy:\n %s\n%s", - $hint, - $untracked_list); - } - if ($unstaged) { $unstaged_list = " ".implode("\n ", $unstaged); $lists[] = pht( @@ -932,12 +901,8 @@ echo implode("\n\n", $lists)."\n"; - $all_uncommitted = array_merge($untracked, $unstaged, $uncommitted); + $all_uncommitted = array_merge($unstaged, $uncommitted); if ($this->askForAdd($all_uncommitted)) { - if ($untracked) { - $api->addToCommit($untracked); - } - if ($unstaged) { $api->addToCommit($unstaged); } @@ -952,20 +917,10 @@ $api->stashChanges(); $this->stashed = true; } else { - if ($untracked && !$unstaged && !$uncommitted) { - // Give a tailored message if there are only untracked files, - // because the advice to commit files does not make sense in - // Subversion. - throw new ArcanistUsageException( - pht( - 'You can not continue with untracked changes. Add them, '. - 'discard them, or mark them as ignored before proceeding.')); - } else { - throw new ArcanistUsageException( - pht( - 'You can not continue with uncommitted changes. Commit '. - 'or discard them before proceeding.')); - } + throw new ArcanistUsageException( + pht( + 'You can not continue with uncommitted changes. Commit '. + 'or discard them before proceeding.')); } } } @@ -980,10 +935,6 @@ "# ".pht('Enter a commit message.')."\n#\n". "# ".pht('Changes:')."\n#\n"; - foreach ($untracked as $untracked_path) { - $template .= "# ".$untracked_path." (".pht('Added').")\n"; - } - $paths = array_merge($uncommitted, $unstaged); $paths = array_unique($paths); sort($paths);