Git: Add Sign off feature in git commit view

Change-Id: Icb0a8818f707d6a874a9b97318fc6a93205b4ce9
Signed-off-by: Tasuku Suzuki <tasuku.suzuki@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Tasuku Suzuki
2016-12-26 09:46:25 +09:00
committed by Orgad Shaneh
parent 405c456d0d
commit ac83af4ef0
5 changed files with 40 additions and 23 deletions

View File

@@ -44,6 +44,7 @@ void GitSubmitEditorPanelData::clear()
email.clear();
bypassHooks = false;
pushAction = NoPush;
signOff = false;
}
QString GitSubmitEditorPanelData::authorString() const

View File

@@ -60,6 +60,7 @@ public:
QString email;
bool bypassHooks;
PushAction pushAction;
bool signOff;
};
enum FileState {

View File

@@ -2529,6 +2529,8 @@ bool GitClient::addAndCommit(const QString &repositoryDirectory,
arguments << "--author" << authorString;
if (data.bypassHooks)
arguments << "--no-verify";
if (data.signOff)
arguments << "--signoff";
}
const SynchronousProcessResponse resp = vcsFullySynchronousExec(repositoryDirectory, arguments);

View File

@@ -137,6 +137,7 @@ GitSubmitEditorPanelData GitSubmitEditorWidget::panelData() const
}
rc.bypassHooks = m_gitSubmitPanelUi.bypassHooksCheckBox->isChecked();
rc.pushAction = m_pushAction;
rc.signOff = m_gitSubmitPanelUi.signOffCheckBox->isChecked();
return rc;
}
@@ -147,6 +148,7 @@ void GitSubmitEditorWidget::setPanelData(const GitSubmitEditorPanelData &data)
m_gitSubmitPanelUi.authorLineEdit->setText(data.author);
m_gitSubmitPanelUi.emailLineEdit->setText(data.email);
m_gitSubmitPanelUi.bypassHooksCheckBox->setChecked(data.bypassHooks);
m_gitSubmitPanelUi.signOffCheckBox->setChecked(data.signOff);
authorInformationChanged();
}

View File

@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>364</width>
<height>198</height>
<height>269</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
@@ -80,7 +80,7 @@
<widget class="QLineEdit" name="authorLineEdit">
<property name="minimumSize">
<size>
<width>150</width>
<width>200</width>
<height>0</height>
</size>
</property>
@@ -101,12 +101,9 @@
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>5</width>
<width>40</width>
<height>20</height>
</size>
</property>
@@ -123,13 +120,13 @@
<widget class="QLineEdit" name="emailLineEdit">
<property name="minimumSize">
<size>
<width>150</width>
<width>200</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item row="1" column="2">
<item row="1" column="2" colspan="2">
<widget class="QLabel" name="invalidEmailLabel">
<property name="minimumSize">
<size>
@@ -140,22 +137,36 @@
</widget>
</item>
<item row="2" column="1">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QCheckBox" name="bypassHooksCheckBox">
<property name="text">
<string/>
<string>By&amp;pass hooks</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label">
<item>
<widget class="QCheckBox" name="signOffCheckBox">
<property name="text">
<string>By&amp;pass hooks:</string>
</property>
<property name="buddy">
<cstring>bypassHooksCheckBox</cstring>
<string>&amp;Sign off</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
</item>