Commit 49b0b5d3 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh
Browse files

Gerrit: Use magic branch options to specify reviewers

Enables specifying reviewers over http[s].

Supported since gerrit 2.6 (specifying reviewers will be broken for
earlier versions).

Prepare for supporting other options (draft, publish, topic...)

Change-Id: Id0b6508409123cddb9dec5ea9e78d7a6a1423057
Reviewed-by: default avatarTobias Hunger <>
Reviewed-by: default avatarFriedemann Kleint <>
parent caef827c
......@@ -326,16 +326,6 @@ void GerritPlugin::push(const QString &topLevel)
QStringList args;
m_reviewers = dialog.reviewers();
const QStringList reviewers = m_reviewers.split(QLatin1Char(','), QString::SkipEmptyParts);
if (!reviewers.isEmpty()) {
QString reviewersFlag(QLatin1String("--receive-pack=git receive-pack"));
foreach (const QString &reviewer, reviewers) {
const QString name = reviewer.trimmed();
if (!name.isEmpty())
reviewersFlag += QString::fromLatin1(" --reviewer=") + name;
args << reviewersFlag;
args << dialog.selectedRemoteName();
QString target = dialog.selectedCommit();
......@@ -346,6 +336,15 @@ void GerritPlugin::push(const QString &topLevel)
const QString topic = dialog.selectedTopic();
if (!topic.isEmpty())
target += QLatin1Char('/') + topic;
QStringList options;
const QStringList reviewers = m_reviewers.split(QLatin1Char(','), QString::SkipEmptyParts);
foreach (const QString &reviewer, reviewers)
options << QLatin1String("r=") + reviewer;
if (!options.isEmpty())
target += QLatin1Char('%') + options.join(QLatin1String(","));
args << target;
gitClient()->push(topLevel, args);
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