From 6db280663f836096c30a9626e7170f4a36d8cc1f Mon Sep 17 00:00:00 2001 From: Bruce Zu Date: Tue, 12 Aug 2014 08:49:36 +0000 Subject: [PATCH 1/9] Revert "Make VisibleRefFilter.Filter reuse the refs passed from JGit." This reverts commit b032a529f83892dfbdfb375c47a90d89756dd8ab. This commit introduced an issue where tags were not replicated under certain circumstances. Bug: Issue 2500 Bug: Issue 1748 Change-Id: I9c902b99c7f656c7002cf3eab9e525f22a22fb85 --- .../java/com/google/gerrit/server/git/VisibleRefFilter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/git/VisibleRefFilter.java b/gerrit-server/src/main/java/com/google/gerrit/server/git/VisibleRefFilter.java index 343b49c23a..5a2071c931 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/git/VisibleRefFilter.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/git/VisibleRefFilter.java @@ -113,7 +113,7 @@ public class VisibleRefFilter extends AbstractAdvertiseRefsHook { TagMatcher tags = tagCache.get(projectName).matcher( tagCache, db, - filterTagsSeperately ? filter(refs).values() : result.values()); + filterTagsSeperately ? filter(db.getAllRefs()).values() : result.values()); for (Ref tag : deferredTags) { if (tags.isReachable(tag)) { result.put(tag.getName(), tag); From 67c263f877c6e95039694a90e0af17187b25403b Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Mon, 1 Sep 2014 11:21:29 +0900 Subject: [PATCH 2/9] Gracefully handle `buck audit` failure Handle exception raised when invoking `buck audit` and exit with an error message, instead of dumping a python Traceback. Change-Id: I3786c4eddffa03117f4437314fc12ee68c689a85 --- tools/pack_war.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/pack_war.py b/tools/pack_war.py index 6c71d81bd3..f794c5c8b2 100755 --- a/tools/pack_war.py +++ b/tools/pack_war.py @@ -33,7 +33,11 @@ jars = set() def link_jars(libs, directory): makedirs(directory) - cp = check_output(['buck', 'audit', 'classpath'] + libs) + try: + cp = check_output(['buck', 'audit', 'classpath'] + libs) + except Exception as e: + print('call to buck audit failed: %s' % e, file=sys.stderr) + exit(1) for j in cp.strip().splitlines(): if j not in jars: jars.add(j) From a4e85b2bcd668a4f789436740f2d9d882d3ee09c Mon Sep 17 00:00:00 2001 From: Bruce Zu Date: Mon, 1 Sep 2014 13:52:00 +0800 Subject: [PATCH 3/9] Restrict the input of plugin_archetype_deploy.sh Input mispelled option of plugin_archetype_deploy.sh it starts to run. Restrict the input to avoid this error. Add confirm before run. Change-Id: I6fdc8b592679c45891210261a47285171b50e35f --- tools/plugin_archetype_deploy.sh | 56 +++++++++++++++++++++----------- 1 file changed, 37 insertions(+), 19 deletions(-) diff --git a/tools/plugin_archetype_deploy.sh b/tools/plugin_archetype_deploy.sh index 929e1fd59d..b5d1a6658a 100755 --- a/tools/plugin_archetype_deploy.sh +++ b/tools/plugin_archetype_deploy.sh @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -help() +function help { cat <<'eof' Usage: plugin_archetype_deploy [option] @@ -21,8 +21,9 @@ Usage: plugin_archetype_deploy [option] Deploys Gerrit plugin Maven archetypes to Maven Central Valid options: - --help show this message - --dry-run don't execute commands, just print them + --help show this message. + --dry-run don't execute commands, just print them. + eof exit } @@ -62,22 +63,39 @@ function build_and_deploy -Dfile=target/$module-$ver.jar } -while [ $# -gt 0 ]; do - test "$1" == --dry-run && dryRun=true - test "$1" == --help && help - shift -done +function confirm +{ + read -n1 -p "Are you sure you want to deploy? [N/y]: " ready + if [[ ! $ready == [Yy] ]]; then + if [[ $ready == [Nn] || -z $ready ]]; then + echo; exit + else + echo; confirm + fi + fi +} -root=$(instroot) -cd "$root" -ver=$(getver GERRIT_VERSION) -[[ $ver == *-SNAPSHOT ]] \ - && url="https://oss.sonatype.org/content/repositories/snapshots" \ - || url="https://oss.sonatype.org/service/local/staging/deploy/maven2" +function run +{ + test ${dryRun:-'false'} == 'false' && confirm + root=$(instroot) + cd "$root" + ver=$(getver GERRIT_VERSION) + [[ $ver == *-SNAPSHOT ]] \ + && url="https://oss.sonatype.org/content/repositories/snapshots" \ + || url="https://oss.sonatype.org/service/local/staging/deploy/maven2" -for d in gerrit-plugin-archetype \ - gerrit-plugin-js-archetype \ - gerrit-plugin-gwt-archetype ; do - (cd "$d"; build_and_deploy) -done + for d in gerrit-plugin-archetype \ + gerrit-plugin-js-archetype \ + gerrit-plugin-gwt-archetype ; do + (cd "$d"; build_and_deploy) + done +} +if [ "$1" == "--dry-run" ]; then + dryRun=true && run +elif [ -z "$1" ]; then + run +else + help +fi From 778fefc8a8bdf76a32952aa86129a541aab846bf Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Mon, 1 Sep 2014 14:32:52 +0900 Subject: [PATCH 4/9] Fix broken formatting in changes REST documentation Change-Id: Ie17c25fb8f1f5956e79c750316b8086419406210 --- Documentation/rest-api-changes.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/rest-api-changes.txt b/Documentation/rest-api-changes.txt index 4c599f141c..6ac9a36d59 100644 --- a/Documentation/rest-api-changes.txt +++ b/Documentation/rest-api-changes.txt @@ -3226,7 +3226,7 @@ In addition `ReviewerInfo` has the following fields: |`kind` |`gerritcodereview#reviewer` |`approvals` | The approvals of the reviewer as a map that maps the label names to the -approval values ("`-2`", "`-1`", " `0`", "`+1`", "`+2`"). +approval values ("`-2`", "`-1`", "`0`", "`+1`", "`+2`"). |========================== [[reviewer-input]] From 22e43cc82355a3bef6e575539cda165aaec81b28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C5=A1a=20=C5=BDivkov?= Date: Fri, 1 Aug 2014 16:33:31 +0200 Subject: [PATCH 5/9] Run change hooks and ref-updated events after indexing is done. The change hooks and ref-updated events were run parallel to the change (re)indexing. This meant that an event-stream sent events to the clients before the change indexing was finished. If a client queried for that change immediately after receiving the event it happened that the response was not-found as the indexing wasn't yet done. Although we haven't had issues with a ref-updated event processors, firing this event will also wait for the indexing task to finish as we never know if a ref-updated event processor may trigger a change query. Change-Id: Iff17c5aeb9675f3991f938d31ef5048ef5b3b956 --- .../google/gerrit/server/change/Abandon.java | 2 +- .../gerrit/server/change/ChangeInserter.java | 14 +++++++----- .../server/change/PatchSetInserter.java | 6 ++--- .../gerrit/server/change/PostReview.java | 22 +++++++++---------- .../gerrit/server/change/PostReviewers.java | 19 ++++++++-------- .../google/gerrit/server/change/Publish.java | 3 ++- .../google/gerrit/server/change/PutTopic.java | 5 +---- .../google/gerrit/server/change/Restore.java | 2 +- .../com/google/gerrit/server/git/MergeOp.java | 17 +++++++------- .../gerrit/server/git/ReceiveCommits.java | 15 +++++++------ 10 files changed, 52 insertions(+), 53 deletions(-) diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/change/Abandon.java b/gerrit-server/src/main/java/com/google/gerrit/server/change/Abandon.java index 33d161c86e..b5ded542ed 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/change/Abandon.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/change/Abandon.java @@ -119,13 +119,13 @@ public class Abandon implements RestModifyView, } catch (Exception e) { log.error("Cannot email update for change " + change.getChangeId(), e); } + indexFuture.checkedGet(); hooks.doChangeAbandonedHook(change, caller.getAccount(), db.patchSets().get(change.currentPatchSetId()), Strings.emptyToNull(input.message), db); ChangeInfo result = json.format(change); - indexFuture.checkedGet(); return result; } diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/change/ChangeInserter.java b/gerrit-server/src/main/java/com/google/gerrit/server/change/ChangeInserter.java index 0da8803576..9fd315a5fa 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/change/ChangeInserter.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/change/ChangeInserter.java @@ -189,12 +189,6 @@ public class ChangeInserter { changeMessage.getKey().getParentKey(), db); } } - gitRefUpdated.fire(change.getProject(), patchSet.getRefName(), - ObjectId.zeroId(), commit); - - if (runHooks) { - hooks.doPatchsetCreatedHook(change, patchSet, db); - } if (sendMail) { try { @@ -210,6 +204,14 @@ public class ChangeInserter { } } f.checkedGet(); + + gitRefUpdated.fire(change.getProject(), patchSet.getRefName(), + ObjectId.zeroId(), commit); + + if (runHooks) { + hooks.doPatchsetCreatedHook(change, patchSet, db); + } + return change; } diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/change/PatchSetInserter.java b/gerrit-server/src/main/java/com/google/gerrit/server/change/PatchSetInserter.java index c059bf4ac0..85da2c54a4 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/change/PatchSetInserter.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/change/PatchSetInserter.java @@ -18,7 +18,6 @@ import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkNotNull; import com.google.common.collect.SetMultimap; -import com.google.common.util.concurrent.CheckedFuture; import com.google.gerrit.common.ChangeHooks; import com.google.gerrit.reviewdb.client.Account; import com.google.gerrit.reviewdb.client.Change; @@ -306,14 +305,13 @@ public class PatchSetInserter { } finally { db.rollback(); } - CheckedFuture f = mergeabilityChecker.newCheck() + mergeabilityChecker.newCheck() .addChange(updatedChange) .reindex() - .runAsync(); + .run(); if (runHooks) { hooks.doPatchsetCreatedHook(updatedChange, patchSet, db); } - f.checkedGet(); return updatedChange; } diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/change/PostReview.java b/gerrit-server/src/main/java/com/google/gerrit/server/change/PostReview.java index 25c63b5d11..49e0125cfe 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/change/PostReview.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/change/PostReview.java @@ -156,22 +156,22 @@ public class PostReview implements RestModifyView } else { indexWrite = Futures. immediateCheckedFuture(null); } - if (message != null) { - if (input.notify.compareTo(NotifyHandling.NONE) > 0) { - email.create( - input.notify, - change, - revision.getPatchSet(), - revision.getAccountId(), - message, - comments).sendAsync(); - } - fireCommentAddedHook(revision); + if (message != null && input.notify.compareTo(NotifyHandling.NONE) > 0) { + email.create( + input.notify, + change, + revision.getPatchSet(), + revision.getAccountId(), + message, + comments).sendAsync(); } Output output = new Output(); output.labels = input.labels; indexWrite.checkedGet(); + if (message != null) { + fireCommentAddedHook(revision); + } return output; } diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/change/PostReviewers.java b/gerrit-server/src/main/java/com/google/gerrit/server/change/PostReviewers.java index e134394a38..83a149229d 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/change/PostReviewers.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/change/PostReviewers.java @@ -245,24 +245,23 @@ public class PostReviewers implements RestModifyView added) + private void emailReviewers(Change change, List added) throws OrmException, EmailException { if (added.isEmpty()) { return; } - // Execute hook for added reviewers - // - PatchSet patchSet = dbProvider.get().patchSets().get(change.currentPatchSetId()); - for (PatchSetApproval psa : added) { - Account account = accountCache.get(psa.getAccountId()).getAccount(); - hooks.doReviewerAddedHook(change, account, patchSet, dbProvider.get()); - } - // Email the reviewers // // The user knows they added themselves, don't bother emailing them. diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/change/Publish.java b/gerrit-server/src/main/java/com/google/gerrit/server/change/Publish.java index 599d5ab5d8..eb493e5922 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/change/Publish.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/change/Publish.java @@ -94,12 +94,13 @@ public class Publish implements RestModifyView, || updatedChange.getStatus() == Change.Status.NEW) { CheckedFuture indexFuture = indexer.indexAsync(updatedChange.getId()); - hooks.doDraftPublishedHook(updatedChange, updatedPatchSet, dbProvider.get()); sender.send(rsrc.getNotes(), update, rsrc.getChange().getStatus() == Change.Status.DRAFT, rsrc.getUser(), updatedChange, updatedPatchSet, rsrc.getControl().getLabelTypes()); indexFuture.checkedGet(); + hooks.doDraftPublishedHook(updatedChange, updatedPatchSet, + dbProvider.get()); } } catch (PatchSetInfoNotAvailableException e) { throw new ResourceNotFoundException(e.getMessage()); diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/change/PutTopic.java b/gerrit-server/src/main/java/com/google/gerrit/server/change/PutTopic.java index 1ef0ee36f7..5c07682d8e 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/change/PutTopic.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/change/PutTopic.java @@ -15,7 +15,6 @@ package com.google.gerrit.server.change; import com.google.common.base.Strings; -import com.google.common.util.concurrent.CheckedFuture; import com.google.gerrit.common.ChangeHooks; import com.google.gerrit.extensions.restapi.AuthException; import com.google.gerrit.extensions.restapi.DefaultInput; @@ -109,11 +108,9 @@ class PutTopic implements RestModifyView, } finally { db.rollback(); } - CheckedFuture indexFuture = - indexer.indexAsync(change.getId()); + indexer.index(db, change); hooks.doTopicChangedHook(change, currentUser.getAccount(), oldTopicName, db); - indexFuture.checkedGet(); } return Strings.isNullOrEmpty(newTopicName) ? Response.none() diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/change/Restore.java b/gerrit-server/src/main/java/com/google/gerrit/server/change/Restore.java index 99c262cd9d..1c1c6149ed 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/change/Restore.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/change/Restore.java @@ -120,13 +120,13 @@ public class Restore implements RestModifyView, } catch (Exception e) { log.error("Cannot email update for change " + change.getChangeId(), e); } + f.checkedGet(); hooks.doChangeRestoredHook(change, caller.getAccount(), db.patchSets().get(change.currentPatchSetId()), Strings.emptyToNull(input.message), dbProvider.get()); ChangeInfo result = json.format(change); - f.checkedGet(); return result; } diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/git/MergeOp.java b/gerrit-server/src/main/java/com/google/gerrit/server/git/MergeOp.java index d92400e02f..9bee079209 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/git/MergeOp.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/git/MergeOp.java @@ -840,6 +840,7 @@ public class MergeOp { db.commit(); sendMergedEmail(c, submitter); + indexer.index(db, c); if (submitter != null) { try { hooks.doChangeMergedHook(c, @@ -852,7 +853,6 @@ public class MergeOp { } finally { db.rollback(); } - indexer.index(db, c); } private Change setMergedPatchSet(Change.Id changeId, final PatchSet.Id merged) @@ -1065,6 +1065,14 @@ public class MergeOp { } })); + if (indexFuture != null) { + try { + indexFuture.checkedGet(); + } catch (IOException e) { + log.error("Failed to index new change message", e); + } + } + if (submitter != null) { try { hooks.doMergeFailedHook(c, @@ -1074,13 +1082,6 @@ public class MergeOp { log.error("Cannot run hook for merge failed " + c.getId(), ex); } } - if (indexFuture != null) { - try { - indexFuture.checkedGet(); - } catch (IOException e) { - log.error("Failed to index new change message", e); - } - } } private void abandonAllOpenChanges() { diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/git/ReceiveCommits.java b/gerrit-server/src/main/java/com/google/gerrit/server/git/ReceiveCommits.java index 625c757d20..d1230dcb1e 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/git/ReceiveCommits.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/git/ReceiveCommits.java @@ -2002,13 +2002,6 @@ public class ReceiveCommits { .addChange(change) .reindex() .runAsync(); - gitRefUpdated.fire(project.getNameKey(), newPatchSet.getRefName(), - ObjectId.zeroId(), newCommit); - hooks.doPatchsetCreatedHook(change, newPatchSet, db); - if (mergedIntoRef != null) { - hooks.doChangeMergedHook( - change, currentUser.getAccount(), newPatchSet, db); - } workQueue.getDefaultQueue() .submit(requestScopePropagator.wrap(new Runnable() { @Override @@ -2037,6 +2030,14 @@ public class ReceiveCommits { })); f.checkedGet(); + gitRefUpdated.fire(project.getNameKey(), newPatchSet.getRefName(), + ObjectId.zeroId(), newCommit); + hooks.doPatchsetCreatedHook(change, newPatchSet, db); + if (mergedIntoRef != null) { + hooks.doChangeMergedHook( + change, currentUser.getAccount(), newPatchSet, db); + } + if (magicBranch != null && magicBranch.isSubmit()) { submit(changeCtl, newPatchSet); } From 7655df08fc4fb171ca24928bf2a8bb130a1c7bdc Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Tue, 2 Sep 2014 18:27:51 +0900 Subject: [PATCH 6/9] Mention deprecation of sortkey parameters in 2.9 release notes Bug: Issue 2878 Change-Id: Idd16d5c932b3237cbaeeb8fc8f31e3ebcbf45034 --- ReleaseNotes/ReleaseNotes-2.9.txt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/ReleaseNotes/ReleaseNotes-2.9.txt b/ReleaseNotes/ReleaseNotes-2.9.txt index e54f15a9bd..2a5705468d 100644 --- a/ReleaseNotes/ReleaseNotes-2.9.txt +++ b/ReleaseNotes/ReleaseNotes-2.9.txt @@ -33,6 +33,9 @@ Important Notes *WARNING:* Support for query via the SQL index is removed. The usage of a secondary index is now mandatory. +*WARNING:* The `sortkey` and `sortkey_prev` options on the query changes +REST endpoint are link:#sortkey-deprecation[deprecated]. + *WARNING:* The new change screen only displays download commands if the `download-commands` core plugin or any other plugin providing download commands is installed. The `download-commands` plugin provides the @@ -299,6 +302,22 @@ REST API ~~~~~~~~ +Changes +^^^^^^^ + + +[[sortkey-deprecation]] +* Results returned by the +link:https://gerrit-documentation.storage.googleapis.com/Documentation/2.9/rest-api-changes.html#list-changes[ +query changes] endpoint are now paginated using offsets instead of sortkeys. ++ +The `sortkey` and `sortkey_prev` parameters on the endpoint are deprecated. The +results are now paginated using the `--limit` (`-n`) option to limit the number +of results, and the `-S` option to set the start point. ++ +Queries with sortkeys are still supported against old index versions, to enable +online reindexing while clients have an older JS version. + Projects ^^^^^^^^ From 025ea3e56078f18c65723f9b4c9c3bcb14b65268 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Wed, 3 Sep 2014 10:47:34 +0900 Subject: [PATCH 7/9] Make `-S` an alias of `--start` in changes query REST API The option had been added with the name `-S`. Change the name to `--start` with `-S` as an alias, making it consistent with the naming in other REST APIs. Add the option to the documentation. Remove the documentation of `-P` and `-N`. These options only exist to support online reindexing from clients with outdated JS, and are deprecated. Keeping them in the documentation will potentially cause confusion. Bug: Issue 2878 Change-Id: I992acf4a3d1aeebb1ef40c6fed1afcb0fe26fa92 --- Documentation/rest-api-changes.txt | 9 ++++----- .../google/gerrit/server/query/change/QueryChanges.java | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Documentation/rest-api-changes.txt b/Documentation/rest-api-changes.txt index 6ac9a36d59..26bf070371 100644 --- a/Documentation/rest-api-changes.txt +++ b/Documentation/rest-api-changes.txt @@ -80,11 +80,10 @@ Query for open changes of watched projects: If the `n` query parameter is supplied and additional changes exist that match the query beyond the end, the last change object has a -`_more_changes: true` JSON field set. Callers can resume a query with -the `N` query parameter, supplying the last change's `_sortkey` field -as the value. When going in the reverse direction with the `P` query -parameter a `_more_changes: true` is put in the first change object if -there are results *before* the first change returned. +`_more_changes: true` JSON field set. + +The `S` or `start` query parameter can be supplied to skip a number +of changes from the list. Clients are allowed to specify more than one query by setting the `q` parameter multiple times. In this case the result is an array of diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/query/change/QueryChanges.java b/gerrit-server/src/main/java/com/google/gerrit/server/query/change/QueryChanges.java index 41c2e236ee..5673cfc9d8 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/query/change/QueryChanges.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/query/change/QueryChanges.java @@ -80,7 +80,7 @@ public class QueryChanges implements RestReadView { imp.setSortkeyBefore(key); } - @Option(name = "-S", metaVar = "CNT", usage = "Number of changes to skip") + @Option(name = "--start", aliases = {"-S"}, metaVar = "CNT", usage = "Number of changes to skip") public void setStart(int start) { imp.setStart(start); } From 4cdda6adaecf80bbe6f6747bfd40d2aa5aeaaf9f Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Thu, 4 Sep 2014 13:53:51 +0900 Subject: [PATCH 8/9] Add full names for options on list projects REST API Change-Id: I1dd7a8b2e27b8172cd8f11c9047063070fa6e698 --- .../java/com/google/gerrit/server/project/ListProjects.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/project/ListProjects.java b/gerrit-server/src/main/java/com/google/gerrit/server/project/ListProjects.java index d0b10dcec4..3f5b9e8095 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/project/ListProjects.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/ListProjects.java @@ -143,17 +143,17 @@ public class ListProjects implements RestReadView { this.limit = limit; } - @Option(name = "-S", metaVar = "CNT", usage = "number of projects to skip") + @Option(name = "--start", aliases = {"-S"}, metaVar = "CNT", usage = "number of projects to skip") public void setStart(int start) { this.start = start; } - @Option(name = "-p", metaVar = "PREFIX", usage = "match project prefix") + @Option(name = "--prefix", aliases = {"-p"}, metaVar = "PREFIX", usage = "match project prefix") public void setMatchPrefix(String matchPrefix) { this.matchPrefix = matchPrefix; } - @Option(name = "-m", metaVar = "MATCH", usage = "match project substring") + @Option(name = "--match", aliases = {"-m"}, metaVar = "MATCH", usage = "match project substring") public void setMatchSubstring(String matchSubstring) { this.matchSubstring = matchSubstring; } From 538e87aaa6ae661307ac06fe9a4ef876f76c6fa3 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Thu, 4 Sep 2014 13:56:47 +0900 Subject: [PATCH 9/9] Add full names for options on list groups REST API Change-Id: I6663eda2adc00c493624438a16ecbf4818e740e1 --- .../main/java/com/google/gerrit/server/group/ListGroups.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/group/ListGroups.java b/gerrit-server/src/main/java/com/google/gerrit/server/group/ListGroups.java index f6b71877a1..09dfef81ec 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/group/ListGroups.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/group/ListGroups.java @@ -90,10 +90,10 @@ public class ListGroups implements RestReadView { @Option(name = "--limit", aliases = {"-n"}, metaVar = "CNT", usage = "maximum number of groups to list") private int limit; - @Option(name = "-S", metaVar = "CNT", usage = "number of groups to skip") + @Option(name = "--start", aliases = {"-S"}, metaVar = "CNT", usage = "number of groups to skip") private int start; - @Option(name = "-m", metaVar = "MATCH", usage = "match group substring") + @Option(name = "--match", aliases = {"-m"}, metaVar = "MATCH", usage = "match group substring") private String matchSubstring; @Option(name = "-o", usage = "Output options per group")