Control which specs are versioned
By default, all specs (//spec/...) are versioned. You can
use the SpecMap field to control which specs are versioned
by adding lines in depot syntax that include (or exclude) paths in the
spec depot.
For example, you can exclude the protections table from versioning by
configuring your spec depot’s SpecMap field as follows:
SpecMap:
//spec/...
-//spec/protect.p4s
Certain formtypes (for example, the protect, triggers, and typemap forms, plus license updates) might have several versions, but only have a single incidence of that type of form on the server. Such formtypes have no objectname. Referencing such formtypes in the SpecMap field of the spec depot requires the suffix .p4s or the wildcard *.
In an environment such as a build farm, in which large numbers of temporary client workspaces and/or labels are created, you can configure the spec depot to exclude them, while keeping track of other changes to client workspaces and labels. For example, a spec depot configured with the following spec mapping:
SpecMap:
//spec/...
-//spec/client/build_ws_*
-//spec/label/temp_label_*
will no longer track changes to client workspaces whose names begin with
build_ws_, nor will it track changes to labels whose names
begin with temp_label_.
Note that adding or changing the SpecMap field only
affects future updates to the spec depot; files already stored in the
spec depot are unaffected.
Hide user information in the spec depot
The spec depot stores a copy of each user specification, including the Email and FullName fields, in //spec/user/username.p4s. Standard users can read these files with p4 print, p4 grep, and p4 diff2.
The dm.user.hideinfo configurable hides the email address and full name of other users only in the output of the p4 users, p4 reviews, and p4 review commands, and prevents standard users from viewing the user specification of another user with p4 user -o.
The dm.user.hideinfo configurable does not hide the values in the spec depot. As with the protections table, you can hide the user specifications in the spec depot only by using protections.
To hide the email address and full name of other users in the spec depot, add an exclusionary line for //spec/user/... to the protections table. An exclusionary line denies all access to every user it matches, including users with the admin or super access level, and it overrides only the lines that precede it in the table. Place the exclusionary line after the lines that grant access to the spec depot. To give administrators back access to the user specifications, add a line after the exclusionary line. For example:
write user * * //... list user * * -//spec/user/... read group p4admins * //spec/user/... super user p4super * //...
In this example, members of the p4admins group and the p4super user can still read the user specifications in the spec depot. All other users cannot.
Excluding //spec/user/... in the SpecMap field is not sufficient, because a SpecMap change affects only future updates and does not remove the user specifications already stored in the spec depot. Use protections to hide the user specifications.