Commit d301fb42 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

Git: Fix description of git status progress



Remove color.status option. Creator can handle ANSI now, so there
is no need to suppress that for user-visible output anymore (Git
is intelligent enough to not print colors, even if we do not explicitly
ask it not to:-)

For the internal uses of git status: Prefer using --porcelain instead
of the -s format. That is meant to be stable and does not use colors
ever.

All supported git versions (>= 1.7.2) support --porcelain.

Task-number: QTCREATORBUG-13277
Change-Id: Idd88bcba0c4e4ed68bb27fbf475fe88fae497f1c
Reviewed-by: default avatarOrgad Shaneh <orgads@gmail.com>
parent 685ea302
...@@ -701,12 +701,6 @@ static inline QString currentDocumentPath() ...@@ -701,12 +701,6 @@ static inline QString currentDocumentPath()
return QString(); return QString();
} }
static inline QStringList statusArguments()
{
return QStringList() << QLatin1String("-c") << QLatin1String("color.status=false")
<< QLatin1String("status");
}
static inline void msgCannotRun(const QString &message, QString *errorMessage) static inline void msgCannotRun(const QString &message, QString *errorMessage)
{ {
if (errorMessage) if (errorMessage)
...@@ -1024,8 +1018,8 @@ void GitClient::merge(const QString &workingDirectory, ...@@ -1024,8 +1018,8 @@ void GitClient::merge(const QString &workingDirectory,
void GitClient::status(const QString &workingDirectory) void GitClient::status(const QString &workingDirectory)
{ {
QStringList statusArgs = statusArguments(); QStringList statusArgs;
statusArgs << QLatin1String("-u"); statusArgs << QLatin1String("status") << QLatin1String("-u");
VcsOutputWindow::setRepository(workingDirectory); VcsOutputWindow::setRepository(workingDirectory);
VcsCommand *command = executeGit(workingDirectory, statusArgs, 0, true); VcsCommand *command = executeGit(workingDirectory, statusArgs, 0, true);
connect(command, SIGNAL(finished(bool,int,QVariant)), VcsOutputWindow::instance(), SLOT(clearRepository()), connect(command, SIGNAL(finished(bool,int,QVariant)), VcsOutputWindow::instance(), SLOT(clearRepository()),
...@@ -2311,14 +2305,15 @@ GitClient::StatusResult GitClient::gitStatus(const QString &workingDirectory, St ...@@ -2311,14 +2305,15 @@ GitClient::StatusResult GitClient::gitStatus(const QString &workingDirectory, St
QByteArray outputText; QByteArray outputText;
QByteArray errorText; QByteArray errorText;
QStringList statusArgs = statusArguments(); QStringList statusArgs;
statusArgs << QLatin1String("status");
if (mode & NoUntracked) if (mode & NoUntracked)
statusArgs << QLatin1String("--untracked-files=no"); statusArgs << QLatin1String("--untracked-files=no");
else else
statusArgs << QLatin1String("--untracked-files=all"); statusArgs << QLatin1String("--untracked-files=all");
if (mode & NoSubmodules) if (mode & NoSubmodules)
statusArgs << QLatin1String("--ignore-submodules=all"); statusArgs << QLatin1String("--ignore-submodules=all");
statusArgs << QLatin1String("-s") << QLatin1String("-b"); statusArgs << QLatin1String("--porcelain") << QLatin1String("-b");
const bool statusRc = fullySynchronousGit(workingDirectory, statusArgs, const bool statusRc = fullySynchronousGit(workingDirectory, statusArgs,
&outputText, &errorText, false); &outputText, &errorText, false);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment