forked from qt-creator/qt-creator
Git: ignore spaces in diff
Ignore spacing changes in diff (based on same setting as used to ignore spacing in git blame). Task-number: QTCREATORBUG-2526
This commit is contained in:
@@ -216,6 +216,8 @@ void GitClient::diff(const QString &workingDirectory,
|
||||
commonDiffArgs << QLatin1String("diff") << QLatin1String(noColorOption);
|
||||
if (m_settings.diffPatience)
|
||||
commonDiffArgs << QLatin1String("--patience");
|
||||
if (m_settings.ignoreSpaceChanges)
|
||||
commonDiffArgs << QLatin1String("--ignore-space-change");
|
||||
if (unstagedFileNames.empty() && stagedFileNames.empty()) {
|
||||
QStringList arguments(commonDiffArgs);
|
||||
arguments << diffArgs;
|
||||
@@ -396,7 +398,7 @@ void GitClient::blame(const QString &workingDirectory,
|
||||
qDebug() << "blame" << workingDirectory << fileName << lineNumber;
|
||||
QStringList arguments(QLatin1String("blame"));
|
||||
arguments << QLatin1String("--root");
|
||||
if (m_plugin->settings().spaceIgnorantBlame)
|
||||
if (m_plugin->settings().ignoreSpaceChanges)
|
||||
arguments << QLatin1String("-w");
|
||||
arguments << QLatin1String("--") << fileName;
|
||||
if (!revision.isEmpty())
|
||||
|
||||
@@ -44,7 +44,7 @@ static const char timeoutKeyC[] = "TimeOut";
|
||||
static const char pullRebaseKeyC[] = "PullRebase";
|
||||
static const char promptToSubmitKeyC[] = "PromptForSubmit";
|
||||
static const char omitAnnotationDateKeyC[] = "OmitAnnotationDate";
|
||||
static const char spaceIgnorantBlameKeyC[] = "SpaceIgnorantBlame";
|
||||
static const char ignoreSpaceChangesC[] = "SpaceIgnorantBlame";
|
||||
static const char diffPatienceKeyC[] = "DiffPatience";
|
||||
static const char winSetHomeEnvironmentKeyC[] = "WinSetHomeEnvironment";
|
||||
static const char gitkOptionsKeyC[] = "GitKOptions";
|
||||
@@ -69,7 +69,7 @@ GitSettings::GitSettings() :
|
||||
pullRebase(bool(defaultPullRebase)),
|
||||
promptToSubmit(true),
|
||||
omitAnnotationDate(false),
|
||||
spaceIgnorantBlame(true),
|
||||
ignoreSpaceChanges(true),
|
||||
diffPatience(true),
|
||||
winSetHomeEnvironment(false)
|
||||
{
|
||||
@@ -85,7 +85,7 @@ void GitSettings::fromSettings(QSettings *settings)
|
||||
pullRebase = settings->value(QLatin1String(pullRebaseKeyC), bool(defaultPullRebase)).toBool();
|
||||
promptToSubmit = settings->value(QLatin1String(promptToSubmitKeyC), true).toBool();
|
||||
omitAnnotationDate = settings->value(QLatin1String(omitAnnotationDateKeyC), false).toBool();
|
||||
spaceIgnorantBlame = settings->value(QLatin1String(spaceIgnorantBlameKeyC), true).toBool();
|
||||
ignoreSpaceChanges = settings->value(QLatin1String(ignoreSpaceChangesC), true).toBool();
|
||||
diffPatience = settings->value(QLatin1String(diffPatienceKeyC), true).toBool();
|
||||
winSetHomeEnvironment = settings->value(QLatin1String(winSetHomeEnvironmentKeyC), false).toBool();
|
||||
gitkOptions = settings->value(QLatin1String(gitkOptionsKeyC)).toString();
|
||||
@@ -102,7 +102,7 @@ void GitSettings::toSettings(QSettings *settings) const
|
||||
settings->setValue(QLatin1String(pullRebaseKeyC), pullRebase);
|
||||
settings->setValue(QLatin1String(promptToSubmitKeyC), promptToSubmit);
|
||||
settings->setValue(QLatin1String(omitAnnotationDateKeyC), omitAnnotationDate);
|
||||
settings->setValue(QLatin1String(spaceIgnorantBlameKeyC), spaceIgnorantBlame);
|
||||
settings->setValue(QLatin1String(ignoreSpaceChangesC), ignoreSpaceChanges);
|
||||
settings->setValue(QLatin1String(diffPatienceKeyC), diffPatience);
|
||||
settings->setValue(QLatin1String(winSetHomeEnvironmentKeyC), winSetHomeEnvironment);
|
||||
settings->setValue(QLatin1String(gitkOptionsKeyC), gitkOptions);
|
||||
@@ -114,7 +114,7 @@ bool GitSettings::equals(const GitSettings &s) const
|
||||
return adoptPath == s.adoptPath && path == s.path && logCount == s.logCount
|
||||
&& timeoutSeconds == s.timeoutSeconds && promptToSubmit == s.promptToSubmit
|
||||
&& pullRebase == s.pullRebase
|
||||
&& omitAnnotationDate == s.omitAnnotationDate && spaceIgnorantBlame == s.spaceIgnorantBlame
|
||||
&& omitAnnotationDate == s.omitAnnotationDate && ignoreSpaceChanges == s.ignoreSpaceChanges
|
||||
&& diffPatience == s.diffPatience && winSetHomeEnvironment == s.winSetHomeEnvironment
|
||||
&& gitkOptions == s.gitkOptions;
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ struct GitSettings
|
||||
bool pullRebase;
|
||||
bool promptToSubmit;
|
||||
bool omitAnnotationDate;
|
||||
bool spaceIgnorantBlame;
|
||||
bool ignoreSpaceChanges;
|
||||
bool diffPatience;
|
||||
bool winSetHomeEnvironment;
|
||||
QString gitkOptions;
|
||||
|
||||
@@ -74,7 +74,7 @@ GitSettings SettingsPageWidget::settings() const
|
||||
rc.pullRebase = m_ui.pullRebaseCheckBox->isChecked();
|
||||
rc.promptToSubmit = m_ui.promptToSubmitCheckBox->isChecked();
|
||||
rc.omitAnnotationDate = m_ui.omitAnnotationDataCheckBox->isChecked();
|
||||
rc.spaceIgnorantBlame = m_ui.spaceIgnorantBlameCheckBox->isChecked();
|
||||
rc.ignoreSpaceChanges = m_ui.spaceIgnorantBlameCheckBox->isChecked();
|
||||
rc.diffPatience = m_ui.diffPatienceCheckBox->isChecked();
|
||||
rc.winSetHomeEnvironment = m_ui.winHomeCheckBox->isChecked();
|
||||
rc.gitkOptions = m_ui.gitkOptionsLineEdit->text().trimmed();
|
||||
@@ -90,7 +90,7 @@ void SettingsPageWidget::setSettings(const GitSettings &s)
|
||||
m_ui.pullRebaseCheckBox->setChecked(s.pullRebase);
|
||||
m_ui.promptToSubmitCheckBox->setChecked(s.promptToSubmit);
|
||||
m_ui.omitAnnotationDataCheckBox->setChecked(s.omitAnnotationDate);
|
||||
m_ui.spaceIgnorantBlameCheckBox->setChecked(s.spaceIgnorantBlame);
|
||||
m_ui.spaceIgnorantBlameCheckBox->setChecked(s.ignoreSpaceChanges);
|
||||
m_ui.diffPatienceCheckBox->setChecked(s.diffPatience);
|
||||
m_ui.winHomeCheckBox->setChecked(s.winSetHomeEnvironment);
|
||||
m_ui.gitkOptionsLineEdit->setText(s.gitkOptions);
|
||||
|
||||
@@ -2,6 +2,14 @@
|
||||
<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>361</width>
|
||||
<height>444</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="environmentGroupBox">
|
||||
@@ -130,7 +138,7 @@
|
||||
<item row="6" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="spaceIgnorantBlameCheckBox">
|
||||
<property name="text">
|
||||
<string>Ignore whitespace changes in annotation</string>
|
||||
<string>Ignore whitespace changes in annotation and diff</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
Reference in New Issue
Block a user