forked from qt-creator/qt-creator
VCS/git: Add setting for diff --patience and make it default.
This commit is contained in:
@@ -233,6 +233,8 @@ void GitClient::diff(const QString &workingDirectory,
|
||||
// Directory diff?
|
||||
QStringList commonDiffArgs;
|
||||
commonDiffArgs << QLatin1String("diff") << QLatin1String(noColorOption);
|
||||
if (m_settings.diffPatience)
|
||||
commonDiffArgs << QLatin1String("--patience");
|
||||
if (unstagedFileNames.empty() && stagedFileNames.empty()) {
|
||||
QStringList arguments(commonDiffArgs);
|
||||
arguments << diffArgs;
|
||||
|
||||
@@ -36,14 +36,15 @@
|
||||
#include <QtCore/QTextStream>
|
||||
#include <QtCore/QCoreApplication>
|
||||
|
||||
static const char *groupC = "Git";
|
||||
static const char *sysEnvKeyC = "SysEnv";
|
||||
static const char *pathKeyC = "Path";
|
||||
static const char *logCountKeyC = "LogCount";
|
||||
static const char *timeoutKeyC = "TimeOut";
|
||||
static const char *promptToSubmitKeyC = "PromptForSubmit";
|
||||
static const char *omitAnnotationDateKeyC = "OmitAnnotationDate";
|
||||
static const char *spaceIgnorantBlameKeyC = "SpaceIgnorantBlame";
|
||||
static const char groupC[] = "Git";
|
||||
static const char sysEnvKeyC[] = "SysEnv";
|
||||
static const char pathKeyC[] = "Path";
|
||||
static const char logCountKeyC[] = "LogCount";
|
||||
static const char timeoutKeyC[] = "TimeOut";
|
||||
static const char promptToSubmitKeyC[] = "PromptForSubmit";
|
||||
static const char omitAnnotationDateKeyC[] = "OmitAnnotationDate";
|
||||
static const char spaceIgnorantBlameKeyC[] = "SpaceIgnorantBlame";
|
||||
static const char diffPatienceKeyC[] = "DiffPatience";
|
||||
|
||||
enum {
|
||||
defaultLogCount = 100 ,
|
||||
@@ -63,7 +64,8 @@ GitSettings::GitSettings() :
|
||||
timeoutSeconds(defaultTimeOut),
|
||||
promptToSubmit(true),
|
||||
omitAnnotationDate(false),
|
||||
spaceIgnorantBlame(true)
|
||||
spaceIgnorantBlame(true),
|
||||
diffPatience(true)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -77,6 +79,7 @@ void GitSettings::fromSettings(QSettings *settings)
|
||||
promptToSubmit = settings->value(QLatin1String(promptToSubmitKeyC), true).toBool();
|
||||
omitAnnotationDate = settings->value(QLatin1String(omitAnnotationDateKeyC), false).toBool();
|
||||
spaceIgnorantBlame = settings->value(QLatin1String(spaceIgnorantBlameKeyC), true).toBool();
|
||||
diffPatience = settings->value(QLatin1String(diffPatienceKeyC), true).toBool();
|
||||
settings->endGroup();
|
||||
}
|
||||
|
||||
@@ -90,6 +93,7 @@ void GitSettings::toSettings(QSettings *settings) const
|
||||
settings->setValue(QLatin1String(promptToSubmitKeyC), promptToSubmit);
|
||||
settings->setValue(QLatin1String(omitAnnotationDateKeyC), omitAnnotationDate);
|
||||
settings->setValue(QLatin1String(spaceIgnorantBlameKeyC), spaceIgnorantBlame);
|
||||
settings->setValue(QLatin1String(diffPatienceKeyC), diffPatience);
|
||||
settings->endGroup();
|
||||
}
|
||||
|
||||
@@ -97,7 +101,8 @@ bool GitSettings::equals(const GitSettings &s) const
|
||||
{
|
||||
return adoptPath == s.adoptPath && path == s.path && logCount == s.logCount
|
||||
&& timeoutSeconds == s.timeoutSeconds && promptToSubmit == s.promptToSubmit
|
||||
&& omitAnnotationDate == s.omitAnnotationDate && spaceIgnorantBlame == s.spaceIgnorantBlame;
|
||||
&& omitAnnotationDate == s.omitAnnotationDate && spaceIgnorantBlame == s.spaceIgnorantBlame
|
||||
&& diffPatience == s.diffPatience;
|
||||
}
|
||||
|
||||
QString GitSettings::gitBinaryPath(bool *ok, QString *errorMessage) const
|
||||
|
||||
@@ -58,6 +58,7 @@ struct GitSettings
|
||||
bool promptToSubmit;
|
||||
bool omitAnnotationDate;
|
||||
bool spaceIgnorantBlame;
|
||||
bool diffPatience;
|
||||
};
|
||||
|
||||
inline bool operator==(const GitSettings &p1, const GitSettings &p2)
|
||||
|
||||
@@ -59,6 +59,7 @@ GitSettings SettingsPageWidget::settings() const
|
||||
rc.promptToSubmit = m_ui.promptToSubmitCheckBox->isChecked();
|
||||
rc.omitAnnotationDate = m_ui.omitAnnotationDataCheckBox->isChecked();
|
||||
rc.spaceIgnorantBlame = m_ui.spaceIgnorantBlameCheckBox->isChecked();
|
||||
rc.diffPatience = m_ui.diffPatienceCheckBox->isChecked();
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -71,6 +72,7 @@ void SettingsPageWidget::setSettings(const GitSettings &s)
|
||||
m_ui.promptToSubmitCheckBox->setChecked(s.promptToSubmit);
|
||||
m_ui.omitAnnotationDataCheckBox->setChecked(s.omitAnnotationDate);
|
||||
m_ui.spaceIgnorantBlameCheckBox->setChecked(s.spaceIgnorantBlame);
|
||||
m_ui.diffPatienceCheckBox->setChecked(s.diffPatience);
|
||||
}
|
||||
|
||||
void SettingsPageWidget::setSystemPath()
|
||||
|
||||
@@ -2,14 +2,6 @@
|
||||
<ui version="4.0">
|
||||
<class>Git::Internal::SettingsPage</class>
|
||||
<widget class="QWidget" name="Git::Internal::SettingsPage">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>409</width>
|
||||
<height>279</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="environmentGroupBox">
|
||||
@@ -121,20 +113,27 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<item row="4" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="omitAnnotationDataCheckBox">
|
||||
<property name="text">
|
||||
<string>Omit date from annotation output</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="2">
|
||||
<item row="5" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="spaceIgnorantBlameCheckBox">
|
||||
<property name="text">
|
||||
<string>Ignore whitespace changes in annotation</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QCheckBox" name="diffPatienceCheckBox">
|
||||
<property name="text">
|
||||
<string>Use "patience diff" algorithm</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
Reference in New Issue
Block a user