need to change iphlen earlier; icmp_error needs original ip_len; cleanups
[unix-history] / usr / src / usr.bin / sccs / sccs.1
CommitLineData
b5dc1377 1.\" Copyright (c) 1983, 1990 The Regents of the University of California.
179426e1 2.\" All rights reserved.
e1920121 3.\"
b5dc1377 4.\" %sccs.include.redist.man%
e1920121 5.\"
b5dc1377 6.\" @(#)sccs.1 2.7 (Berkeley) %G%
179426e1 7.\"
b5dc1377
CL
8.Dd
9.Os BSD 4.4
10.Dt SCCS 1
11.Os BSD 4.2
12.Sh NAME
13.Nm sccs
14.Nd front end for the
15.Li SCCS
16subsystem
17.Sh SYNOPSIS
18.Nm sccs
19.Op Fl r
20.Op Fl d Ar path
21.Op Fl p Ar path
22.Ar command
23.Op flags
24.Ar
25.Sh DESCRIPTION
26.Nm Sccs
27is a front end to the
28.Li SCCS
2de7ab2b 29programs
b5dc1377
CL
30that
31helps them mesh more cleanly
32with
33the rest of UNIX.
34It
35also includes the capability to run
36.Dq set user id
37to another user
38to
39provide additional protection.
40.Pp
39ae1365 41Basically,
b5dc1377
CL
42.Nm sccs
43runs the command with the specified
44.Ar flags
39ae1365 45and
b5dc1377
CL
46.Ar args .
47Each argument is normally modified to be prepended with
48.Dq Li SCCS/s. .
49.Pp
39ae1365 50Flags to be interpreted by the
b5dc1377 51.Nm sccs
39ae1365 52program must be before the
b5dc1377 53.Ar command
39ae1365
EA
54argument.
55Flags to be passed to the actual
b5dc1377
CL
56.Li SCCS
57program must come after the
58.Ar command
39ae1365 59argument.
b5dc1377
CL
60These flags are specific to the command and
61are discussed in the documentation for that command.
62.Pp
9e6171bb 63Besides the usual
b5dc1377 64.Li SCCS
9e6171bb 65commands,
b5dc1377
CL
66several
67.Dq pseudo-commands
68can be issued.
9e6171bb 69These are:
b5dc1377
CL
70.Tw Fl
71.Tp Ic edit
72Equivalent
73to
74.Dq Li get \-e .
75.Tp Ic delget
76Perform a delta on the named files and
77then get new versions.
78The new versions will have id keywords expanded, and
79will not be editable.
80The
81.Fl m ,
82.Fl p ,
83.Fl r ,
84.Fl s ,
85and
86.Fl y
87flags will be passed to
88.Nm delta ,
89and the
90.Fl b,
91.Fl c ,
92.Fl e ,
93.Fl i ,
94.Fl k ,
95.Fl l ,
96.Fl s ,
97.\" anybody who has a bad xterm which is almost anyone
98.if n \{\
99. br
100.\}
101and
102.Fl x
103flags will be passed to get.
104.Tp Ic deledit
105Equivalent
106to
107.Nm delget
108except that the
109.Nm get
110phase includes the
111.Fl e
112flag.
113This
114option is useful for making a
115.Em checkpoint
116of your current editing phase. The same flags will be passed to delta
117as described above, and
118all the flags listed for
119.om get
120above except
121.Fl e
122and
123.Fl k
124are
125passed to
126.Nm edit .
127.Tp Ic create
128Creates
129an
130.Li SCCS
131file ,
132taking
133the initial contents from the file of the same name.
134Any
135flags to
136.Nm admin
137are accepted. If the creation is successful,
9be60522 138the files are renamed with a comma on the front.
b5dc1377
CL
139These should be removed when you are convinced that the
140.Li SCCS
141files
142have been created successfully.
143.Tp Ic fix
144Must
145be followed by a
146.Fl r
9e6171bb 147flag.
b5dc1377
CL
148This command essentially removes the named delta, but
149leaves you with a copy of the delta
150with the changes that were in it. It
151is useful for fixing small compiler bugs, etc.
152Since it doesn't leave audit trails, it should be used carefully.
153.Tp Ic clean
9e6171bb
EA
154This routine removes everything from the current directory
155that can be recreated from SCCS files.
c3a8e591 156It will not remove any files being edited.
28ad8b5d 157If the
b5dc1377
CL
158.Fl b
159flag is given, branches are ignored in the determination of
160whether they are being edited; this
161is dangerous if you are keeping the branches in the
28ad8b5d 162same directory.
b5dc1377
CL
163.Tp Ic unedit
164This
165is the opposite of an
166.Nm edit
167or
168a
169.Dq Li get \-e .
170It should be used with extreme caution, since
171any changes you made since the get will be irretrievably lost.
172.Tp Ic info
c3a8e591 173Gives a listing of all files being edited.
28ad8b5d 174If the
b5dc1377
CL
175.Fl b
176flag
177is given, branches (i.e.,
178.Cx Li SID
179.Cx \&\'s
180.Cx
181with two or fewer components)
182are ignored. If the
183.Fl u
184flag is given (with an optional argument) then
185only files being edited by you (or the named user) are listed.
186.Tp Ic check
187Like
188.Nm info
189except that nothing is printed if nothing is being edited, and
190a non-zero exit status is returned if anything is being edited.
191The intent is to have this included in an
192.Em install
193entry in a makefile to insure that everything is included into the
194.Li SCCS
195file before a version is installed.
196.Tp Ic tell
197Gives a newline-separated list of the files being edited
198on the standard output. Takes the
199.Fl b
200and
201.Fl u
202flags like
203.Nm info
6aac25be 204and
b5dc1377
CL
205.Nm check .
206.Tp Ic diffs
207Gives a
208.Nm diff
209listing between the current version of the
210program(s) you have out for editing and the versions in
211.Li SCCS
ecf8b19b 212format.
63fe484d 213The
b5dc1377
CL
214.Fl r ,
215.Fl c ,
216.Fl i ,
217.Fl x ,
63fe484d 218and
b5dc1377 219.Fl t
63fe484d 220flags are passed to
b5dc1377
CL
221.if n \{\
222. br
223.\}
224.Nm get ;
225the
226.Fl l ,
227.Fl s ,
228.Fl e ,
229.Fl f ,
230.Fl h ,
63fe484d 231and
b5dc1377 232.Fl b
63fe484d 233options are passed to
b5dc1377
CL
234.if n \{\
235. br
236.\}
237.Nm diff .
63fe484d 238The
b5dc1377 239.Fl C
63fe484d 240flag is passed to
b5dc1377 241.Nm diff
63fe484d 242as
b5dc1377
CL
243.Fl c .
244.Tp Ic print
23320296
EA
245This command prints out verbose information
246about the named files.
b5dc1377
CL
247.Pp
248.Tp Fl r
249Runs
250.Nm sccs
251as the real user rather than as whatever effective user
252.Nm sccs
253is
254.Dq Li set user id
255to.
256.Tp Fl d
257Specifies a root directory for the
258.Li SCCS
c3a8e591
EA
259files.
260The default is the current directory.
b5dc1377
CL
261If environment variable
262.Ev PROJECT
263is set,
264it will be used to determine the
265.Fl d
266flag.
267.Tp Fl p
268flag defines the pathname of the directory in which the
269.Li SCCS
c3a8e591 270files will be found;
b5dc1377
CL
271.Dq Li SCCS
272is the default.
e5b52011 273The
b5dc1377
CL
274.Fl p
275flag
276differs from the
277.Fl d
278flag
279in that the
280.Fl d
281argument is prepended to the entire pathname and the
282.Fl p
283argument is inserted before the final component of the pathname.
e5b52011 284For example,
b5dc1377 285.Dq Li sccs \-d/x \-py get a/b
e5b52011 286will convert to
b5dc1377 287.Dq Li get /x/a/y/s.b .
e5b52011 288The intent here is to create aliases such as
b5dc1377
CL
289.Dq Li alias syssccs sccs -d/usr/src
290which
291will be used as
292.Dq Li syssccs get cmd/who.c .
293.Pp
294Certain
295commands (such as
296.Nm admin )
297cannot be run
298.Dq Li set user id
299by all users, since this would allow anyone to change the authorizations.
af83554c 300These commands are always run as the real user.
b5dc1377 301.Sh EXAMPLES
c3a8e591 302To get a file for editing,
39ae1365
EA
303edit it,
304and produce a new delta:
b5dc1377
CL
305.Pp
306.Dl sccs get \-e file.c
307.Dl ex file.c
308.Dl sccs delta file.c
309.Pp
39ae1365 310To get a file from another directory:
b5dc1377
CL
311.Pp
312.Dl sccs \-p/usr/src/sccs/s. get cc.c
313.Pp
39ae1365 314or
b5dc1377
CL
315.Pp
316.Dl sccs get /usr/src/sccs/s.cc.c
317.Pp
39ae1365
EA
318To make a delta of a large number of files
319in the current directory:
b5dc1377
CL
320.Pp
321.Dl sccs delta *.c
322.Pp
6aac25be 323To get a list of files being edited that are not on branches:
b5dc1377
CL
324.Pp
325.Dl sccs info \-b
326.Pp
6aac25be 327To delta everything being edited by you:
b5dc1377
CL
328.Pp
329.Dl sccs delta \`sccs tell \-u\`
330.Pp
39ae1365
EA
331In a makefile, to get source files
332from an
b5dc1377 333.Li SCCS
39ae1365 334file if it does not already exist:
b5dc1377
CL
335.Pp
336.Dl SRCS = <list of source files>
337.Dl $(SRCS):
338.Dl \&\tsccs get $(REL) $@
339.Sh ENVIRONMENT
340.Tw Ar
341.Tp Ev PROJECT
342The PROJECT environment variable is checked by the
343.Fl d
344flag. If
345it begins with a slash, it is taken directly; otherwise,
346the home directory of a user of that name is
347examined for a subdirectory
348.Dq Li src
349or
350.Dq Li source .
351If such a directory is found, it is used.
352.Tp
353.Sh SEE ALSO
354.Xr what 1
355.Xr admin SCCS ,
356.Xr chghist SCCS ,
357.Xr comb SCCS ,
358.Xr delta SCCS ,
359.Xr get SCCS ,
360.Xr help SCCS ,
361.Xr prt SCCS ,
362.Xr rmdel SCCS ,
363.Xr sccsdiff SCCS ,
813d780e
EA
364.br
365Eric Allman,
b5dc1377
CL
366.Em An Introduction to the Source Code Control System
367.Sh HISTORY
368.Nm Sccs
369appeared in 4.3 BSD.
370.Sh BUGS
d35f5db1
EA
371It should be able to take directory arguments on pseudo-commands
372like the
b5dc1377 373.Li SCCS
d35f5db1 374commands do.