xref: /illumos-gate/usr/src/tools/scripts/git-pbchk.1onbld (revision e00bdde3c6d406f40f53f3025defadc22f7ec31a)
1.\"
2.\" This file and its contents are supplied under the terms of the
3.\" Common Development and Distribution License ("CDDL"), version 1.0.
4.\" You may only use this file in accordance with the terms of version
5.\" 1.0 of the CDDL.
6.\"
7.\" A full copy of the text of the CDDL should have accompanied this
8.\" source.  A copy of the CDDL is also available via the Internet at
9.\" http://www.illumos.org/license/CDDL.
10.\"
11.\"
12.\" Copyright 2011 Richard Lowe.
13.\" Copyright 2015 Elysium Digital, L.L.C.
14.\" Copyright 2018 Joyent, Inc.
15.\" Copyright 2024 Bill Sommerfeld <sommerfeld@hamachi.org>
16.\"
17.Dd February 1, 2024
18.Dt GIT-PBCHK 1ONBLD
19.Os
20.Sh NAME
21.Nm git-pbchk ,
22.Nm git-nits
23.Nd nits and pre-putback checks for git
24.Sh SYNOPSIS
25.Nm git-pbchk
26.Fl l
27.Nm git-pbchk
28.Op Fl c Ar check Ns ...
29.Op Fl p Ar branch
30.Nm git-nits
31.Op Fl c Ar check Ns ...
32.Op Fl p Ar branch
33.Op Ar file Ns ...
34.Sh DESCRIPTION
35Check your workspace for common nits and putback-ending mistakes.
36A simple set of checks are run over various parts of your workspace
37and errors encountered are reported, all of which should, generally,
38be fixed.
39.Pp
40As these command names start with
41.Sq git-
42they can also be run by
43.Xr git 1
44as subcommands:
45.Pp
46.Dl $ git pbchk
47.Sh OPTIONS
48.Bl -tag -width 6n
49.It Fl c Ar check
50Run the specific
51.Ar check ,
52as named below.
53In this mode, individual files can be provided to check.
54Multiple
55.Fl c
56options can be supplied, and will run the named checks in the order given on
57the command line.
58.It Fl p Ar branch
59Compare the current workspace to the parent
60.Ar branch
61for the purposes of generating file and comment lists.
62.Pp
63If this option is not specified an attempt is made to determine this
64automatically, if the git branch configuration contains this information.
65.Pp
66If no branch is specified and none can be determined automatically
67.Pa origin/master
68is used.
69.It Fl l
70Print a list of the checks that can be used with
71.Fl c ,
72with a short description of each one.
73.El
74.Sh CHECKS
75.Bl -tag -width 6n
76.It Comment format: Cm comchk
77Check that putback comments follow the prescribed format
78.Pq only run for pbchk .
79.It Copyrights: Cm copyright
80Check that each source file contains a copyright notice for the current
81year\. You don't need to fix this if you, the potential new copyright holder,
82chooses not to
83.It C style: Cm cstyle
84Check that C source files conform to the illumos C style rules
85.It Header check: Cm hdrchk
86Check that C header files conform to the illumos header style rules
87.Pq in addition to the general C rules .
88.It Java style: Cm jstyle
89Check that Java source files conform to the illumos Java style rules
90.Pq which differ from the traditionally recommended Java style .
91.It SCCS Keywords: Cm keywords
92Check that no source files contain unexpanded SCCS keywords.
93It is possible that this check may false positive on certain inputs.
94It is generally obvious when this is the case.
95.Pp
96This check does not check for expanded SCCS keywords, though the common
97.Sq ident Ns
98-style lines should be removed regardless of whether they are
99expanded.
100.It Man page check: Cm manlint
101Check for problems with man pages.
102.It Mapfile check: Cm mapfilechk
103Check that linker mapfiles contain a comment directing anyone editing to
104read the directions in
105.Pa usr/lib/README.mapfiles .
106.It Shell script check: Cm shelllint
107Check for problems with shell scripts.
108.It Package manifest formatting: Cm pkgfmt
109Check package manifests for common errors.
110.It Windows special filename check Cm winnames
111Check for filenames which would prevent you from checking out
112illumos-gate on a Windows system.
113.It Whitespace check: Cm wscheck
114Check for whitespace issues such as mixed tabs/spaces in source files.
115.It Committed symlinks check: Cm symlinks
116Report if there are any symlinks checked into your change; they are
117not allowed by illumos policy.
118.El
119.Sh FILES
120Exception lists can be used to exclude certain files from checks, named after
121the specific check.
122They can be found in
123.Pa $CODEMGR_WS/exception_lists ,
124or optionally under
125.Pa $CODEMGR_WS/.git/info/ ,
126where they must be suffixed
127.Pa .NOT .
128.Sh SEE ALSO
129.Xr git 1
130