xref: /illumos-gate/usr/src/tools/scripts/git-pbchk.1onbld (revision a89c0811c892ec231725fe10817ef95dda813c06)
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.Op Fl c Ar check
27.Op Fl p Ar branch
28.Nm git-nits
29.Op Fl c Ar check
30.Op Fl p Ar branch
31.Op Ar file Ns ...
32.Sh DESCRIPTION
33Check your workspace for common nits and putback-ending mistakes.
34A simple set of checks are run over various parts of your workspace
35and errors encountered are reported, all of which should, generally,
36be fixed.
37.Pp
38As these command names start with
39.Sq git-
40they can also be run by
41.Xr git 1
42as subcommands:
43.Pp
44.Dl $ git pbchk
45.Sh OPTIONS
46.Bl -tag -width 6n
47.It Fl c Ar check
48Run the specific
49.Ar check ,
50as named below.
51In this mode, individual files can be provided to check.
52.It Fl p Ar branch
53Compare the current workspace to the parent
54.Ar branch
55for the purposes of generating file and comment lists.
56.Pp
57If this option is not specified an attempt is made to determine this
58automatically, if the git branch configuration contains this information.
59.Pp
60If no branch is specified and none can be determined automatically
61.Pa origin/master
62is used.
63.El
64.Sh CHECKS
65.Bl -tag -width 6n
66.It Comment format: Cm comchk
67Check that putback comments follow the prescribed format
68.Pq only run for pbchk .
69.It Copyrights: Cm copyright
70Check that each source file contains a copyright notice for the current
71year\. You don't need to fix this if you, the potential new copyright holder,
72chooses not to
73.It C style: Cm cstyle
74Check that C source files conform to the illumos C style rules
75.It Header check: Cm hdrchk
76Check that C header files conform to the illumos header style rules
77.Pq in addition to the general C rules .
78.It Java style: Cm jstyle
79Check that Java source files conform to the illumos Java style rules
80.Pq which differ from the traditionally recommended Java style .
81.It SCCS Keywords: Cm keywords
82Check that no source files contain unexpanded SCCS keywords.
83It is possible that this check may false positive on certain inputs.
84It is generally obvious when this is the case.
85.Pp
86This check does not check for expanded SCCS keywords, though the common
87.Sq ident Ns
88-style lines should be removed regardless of whether they are
89expanded.
90.It Man page check: Cm manlint
91Check for problems with man pages.
92.It Mapfile check: Cm mapfilechk
93Check that linker mapfiles contain a comment directing anyone editing to
94read the directions in
95.Pa usr/lib/README.mapfiles .
96.It Shell script check: Cm shelllint
97Check for problems with shell scripts.
98.It Package manifest formatting: Cm pkgfmt
99Check package manifests for common errors.
100.It Windows special filename check Cm winnames
101Check for filenames which would prevent you from checking out
102illumos-gate on a Windows system.
103.It Whitespace check: Cm wscheck
104Check for whitespace issues such as mixed tabs/spaces in source files.
105.It Committed symlinks check: Cm symlinks
106Report if there are any symlinks checked into your change; they are
107not allowed by illumos policy.
108.El
109.Sh FILES
110Exception lists can be used to exclude certain files from checks, named after
111the specific check.
112They can be found in
113.Pa $CODEMGR_WS/exception_lists ,
114or optionally under
115.Pa $CODEMGR_WS/.git/info/ ,
116where they must be suffixed
117.Pa .NOT .
118.Sh SEE ALSO
119.Xr git 1
120