Package com.google.gerrit.entities
Class RefNames
java.lang.Object
com.google.gerrit.entities.RefNames
Constants and utilities for Gerrit-specific ref names.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final com.google.common.collect.ImmutableList<String>
List of refs managed by Gerrit.static final String
static final String
Suffix of a meta ref in the NoteDb.static final String
static final String
Prefix applied to merge commit base nodes.static final String
static final String
Configuration settings for a projectrefs/meta/config
static final String
Configurations of project-specific dashboards (canned search queries).static final String
NoteDb ref for deleted groupsrefs/deleted-groups
.static final String
Draft inline comments of a user on a changestatic final String
Note tree listing external IDsstatic final String
NoteDb ref for the NoteMap of all group namesstatic final String
NoteDb ref for a grouprefs/groups
static final String
static final String
static final String
Note tree listing commits we refuserefs/meta/reject-commits
static final String
Sequence counters in NoteDb.static final String
A change starred by a userstatic final String
static final String
Preference settings for a userrefs/users
static final String
Default user preference settingsstatic final String
Magic user branch in All-Usersrefs/users/self
static final String
NoteDb schema version number.static final String
Suffix of a ref that stores robot comments in the NoteDb. -
Method Summary
Modifier and TypeMethodDescriptionstatic String
Warning: Change refs have to manually be advertised incom.google.gerrit.server.permissions.DefaultRefFilter
; this should be done when adding new change refs.static String
static String
static boolean
isAutoMergeRef
(String ref) Whether the ref is an auto-merge ref.static boolean
isConfigRef
(String ref) Whether the ref is the configuration branch, i.e.static boolean
isExternalIdRef
(String ref) True if the provided ref isREFS_EXTERNAL_IDS
.static boolean
isGerritRef
(String ref) Whether the ref is managed by Gerrit.static boolean
isGroupRef
(String ref) Whether the ref is used for storing group data in NoteDb.static boolean
isNoteDbMetaRef
(String ref) static boolean
isRefsChanges
(String ref) True if the provided ref is inrefs/changes/*
.static boolean
Whether the ref is a group branch that stores NoteDb data of a deleted group.static boolean
Returns true if the provided ref is for draft comments.static boolean
isRefsEdit
(String ref) static boolean
isRefsGroups
(String ref) Whether the ref is a group branch that stores NoteDb data of a group.static boolean
Returns true if the provided ref is for starred changes.static boolean
isRefsUsers
(String ref) static boolean
isRefsUsersSelf
(String ref, boolean isAllUsers) static boolean
isRejectCommitsRef
(String ref) Whether the ref is an reject commit ref, i.e.static boolean
isSequenceRef
(String ref) True if the provided ref is inrefs/sequences/*
.static boolean
True if the provided ref is inrefs/tags/*
.static boolean
isVersionRef
(String ref) Whether the ref is the version branch, i.e.static Integer
parseRefSuffix
(String name) static String
static String
static String
refsCacheAutomerge
(String hash) static String
refsDeletedGroups
(AccountGroup.UUID groupUuid) static String
refsDraftComments
(Change.Id changeId, Account.Id accountId) static String
refsDraftCommentsPrefix
(Change.Id changeId) static String
refsEdit
(Account.Id accountId, Change.Id changeId, PatchSet.Id psId) Returns reference for this change edit with sharded user and change number: refs/users/UU/UUUU/edit-CCCC/P.static String
refsEditPrefix
(Account.Id accountId) static String
refsEditPrefix
(Account.Id accountId, Change.Id changeId) Returns reference prefix for this change edit with sharded user and change number: refs/users/UU/UUUU/edit-CCCC/.static String
refsGroups
(AccountGroup.UUID groupUuid) static String
refsStarredChanges
(Change.Id changeId, Account.Id accountId) static String
refsStarredChangesPrefix
(Change.Id changeId) static String
refsUsers
(Account.Id accountId) static String
static String
shard
(int id) static String
static final String
-
Field Details
-
HEAD
- See Also:
-
REFS
- See Also:
-
REFS_HEADS
- See Also:
-
REFS_TAGS
- See Also:
-
REFS_CHANGES
- See Also:
-
REFS_META
- See Also:
-
REFS_REJECT_COMMITS
Note tree listing commits we refuserefs/meta/reject-commits
- See Also:
-
REFS_CONFIG
Configuration settings for a projectrefs/meta/config
- See Also:
-
REFS_EXTERNAL_IDS
Note tree listing external IDs- See Also:
-
REFS_USERS_SELF
Magic user branch in All-Usersrefs/users/self
- See Also:
-
REFS_USERS_DEFAULT
Default user preference settings- See Also:
-
REFS_DASHBOARDS
Configurations of project-specific dashboards (canned search queries).- See Also:
-
REFS_SEQUENCES
Sequence counters in NoteDb.- See Also:
-
REFS_VERSION
NoteDb schema version number.- See Also:
-
REFS_CACHE_AUTOMERGE
Prefix applied to merge commit base nodes.References in this directory should take the form
refs/cache-automerge/xx/yyyy...
where xx is the first two digits of the merge commit's object name, and yyyyy... is the remaining 38. The reference should point to a treeish that is the automatic merge result of the merge commit's parents.- See Also:
-
META_SUFFIX
Suffix of a meta ref in the NoteDb.- See Also:
-
ROBOT_COMMENTS_SUFFIX
Suffix of a ref that stores robot comments in the NoteDb.- See Also:
-
EDIT_PREFIX
- See Also:
-
REFS_USERS
Preference settings for a userrefs/users
- See Also:
-
REFS_GROUPS
NoteDb ref for a grouprefs/groups
- See Also:
-
REFS_GROUPNAMES
NoteDb ref for the NoteMap of all group names- See Also:
-
REFS_DELETED_GROUPS
NoteDb ref for deleted groupsrefs/deleted-groups
. This ref namespace is foreseen as an attic for deleted groups (it's reserved but not used yet)- See Also:
-
REFS_DRAFT_COMMENTS
Draft inline comments of a user on a change- See Also:
-
REFS_STARRED_CHANGES
A change starred by a user- See Also:
-
GERRIT_REFS
List of refs managed by Gerrit. Covers all Gerrit internal refs.Caution Any ref not in this list will be served if the user was granted a READ permission on it using Gerrit's permission model.
-
-
Method Details
-
fullName
-
shortName
-
changeMetaRef
Warning: Change refs have to manually be advertised incom.google.gerrit.server.permissions.DefaultRefFilter
; this should be done when adding new change refs. -
patchSetRef
-
changeRefPrefix
-
robotCommentsRef
-
isNoteDbMetaRef
-
isRefsChanges
True if the provided ref is inrefs/changes/*
. -
isSequenceRef
True if the provided ref is inrefs/sequences/*
. -
isTagRef
True if the provided ref is inrefs/tags/*
. -
isExternalIdRef
True if the provided ref isREFS_EXTERNAL_IDS
. -
refsGroups
-
refsDeletedGroups
-
refsUsers
-
refsDraftComments
-
refsDraftCommentsPrefix
-
refsStarredChanges
-
refsStarredChangesPrefix
-
refsCacheAutomerge
-
shard
-
shardUuid
-
refsEdit
Returns reference for this change edit with sharded user and change number: refs/users/UU/UUUU/edit-CCCC/P.- Parameters:
accountId
- account idchangeId
- change numberpsId
- patch set number- Returns:
- reference for this change edit
-
refsEditPrefix
Returns reference prefix for this change edit with sharded user and change number: refs/users/UU/UUUU/edit-CCCC/.- Parameters:
accountId
- account idchangeId
- change number- Returns:
- reference prefix for this change edit
-
refsEditPrefix
-
isRefsEdit
-
isRefsUsers
-
isRefsUsersSelf
-
isRefsGroups
Whether the ref is a group branch that stores NoteDb data of a group. Returnstrue
for all refs that start withrefs/groups/
. -
isRefsDeletedGroups
Whether the ref is a group branch that stores NoteDb data of a deleted group. Returnstrue
for all refs that start withrefs/deleted-groups/
. -
isRefsDraftsComments
Returns true if the provided ref is for draft comments. -
isRefsStarredChanges
Returns true if the provided ref is for starred changes. -
isGroupRef
Whether the ref is used for storing group data in NoteDb. Returnstrue
for all group branches, refs/meta/group-names and deleted group branches. -
isConfigRef
Whether the ref is the configuration branch, i.e.refs/meta/config
, for a project. -
isVersionRef
Whether the ref is the version branch, i.e.refs/meta/version
. -
isAutoMergeRef
Whether the ref is an auto-merge ref. -
isRejectCommitsRef
Whether the ref is an reject commit ref, i.e.refs/meta/reject-commits
-
isGerritRef
Whether the ref is managed by Gerrit. Covers all Gerrit-internal refs like refs/cache-automerge and refs/meta as well as refs/changes. Does not cover user-created refs like branches or custom ref namespaces like refs/my-company.Any ref for which this method evaluates to true will be served to users who have the
ACCESS_DATABASE
capability.Caution Any ref not in this list will be served if the user was granted a READ permission on it using Gerrit's permission model.
-
parseShardedUuidFromRefPart
-
parseRefSuffix
-