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