@need 3200

@node arch Project Inventories
@chapter arch Project Inventories

In a project tree, some of the files and directories are "part of
the source" -- they are of interest to @code{arch}.  Other files and
directories may be scratch files, editor back-up files, and temporary
or intermediate files generated by programs.  Those other files should
be ignored by most @code{arch} commands.


This chapter discusses how @code{arch} recognizes which files to pay
attention to, and which to ignore.


@code{arch} has flexible facilities for keeping track of all of the files
and directories in your project: for taking "inventories" of your
project tree.  It has these facilities for three reasons:


@strong{Distinguishing Source} @code{arch} uses a project inventory to
distingiuish files and directories which are part of your project from
other files and directories which are temporary files, scratch files,
editor backup-files, and so forth.


Additionally, @code{arch} permits you to overlay projects: store more than
one project at a single root.  When you do that, @code{arch} uses
inventories to sort out which files and directories belong to each
project.  (The topic of overlays, however, is deferred until a later
chapter.)


@strong{Recognizing Renames} Every file or directory in an @code{arch} inventory
has two names.  One name is simply the location (path) of the file
relative to the root of the project tree.  The other name is a
"logical name" for the file: a name that remains the same regardless
of where in the project tree the file is located.  When @code{arch}
compares two versions of a project tree, it uses logical names to
discover when files or directories have been moved, renamed, deleted,
or added.


@strong{Canonical Inventories} Finally, @code{arch} permits you to make a record
of the "canonical inventory" of your project -- all of the files
that you believe are @emph{@strong{supposed}} to be there.  @code{arch} can then tell you
whether any files are missing or have been added compared to the
canonical inventory.

@menu
* Choices Regarding Inventories::
* Specifying a Tagging Method::
* The inventory Command::
* Using an Explicit Inventory::
* Using an Implicit Inventory::
* Recognizing Renames -- Inventory Tags::
* Keeping Things Neat and Tidy::
* Avoiding Accidental Ommissions and Additions::
* The Inventory Tag Abstraction in Detail::
* A Warning About Changing Tagging Methods::
* Other Ways to Tag Files::
* Telling tree-lint to Shut Up::
* Which Tagging Method Should You Use?::
* Altering the Naming Conventions::
@end menu

@need 3200

@node Choices Regarding Inventories
@section Choices Regarding Inventories

For each project tree, you have a choice to make regarding how project
inventories work.  The options are described briefly here, then in
more detail in the sections that follow.


@strong{Naming Conventions} The simplest (and default) option is to simply
use @geindex naming conventions
@dfn{naming conventions}.  @code{arch} will search your tree for files
matching certain naming patterns, and consider all of those files to
be source files.


When you use only naming conventions to take an inventory, the logical
name of a file and its location name are exactly the same.  For that
reason, if you rename a file, @code{arch} will think you deleted a file
with the old name, and added a file with the new name.  If you delete
a file, then add a file with the same name, @code{arch} will think that the
new file is a modified form of the old file.  None of those
limitations are fatal, @code{arch} will still work, but they do limit the
effectiveness of @code{arch} at branching and merging.  ("Branching" and
"merging" are topics of a later chapter.)


@strong{Explicit Inventories} Another option is to use an @geindex explicit inventory
@dfn{explicit inventory}.
Once again, @code{arch} will search for files that satisfy certain naming
conventions -- but not every such file or directory is automatically
source.  Instead, whenever you add, delete or renamed a file, you must
inform @code{arch} of that fact explicitly.  For example, after adding the
file @code{foo.c}, you have to tell @code{arch}:

@example
@group
        % larch add foo.c
@end group
@group
@end group
@end example

@noindent
and if you rename @code{foo.c} to @code{bar.c}, then you must also tell @code{arch}:

@example
@group
        % larch move foo.c bar.c
@end group
@group
@end group
@end example

@strong{Implicit Inventories} A third option combines some of the advantages
of using naming conventions with some of the advantages of explicit
inventories: @geindex implicit inventories
@dfn{implicit inventories}.  When you use an implicit
inventory, every file that passes the naming conventions is considered
source.  You @emph{@strong{may}} explicitly add, delete, and rename files --
allowing @code{arch} to precisely track renames for those files and
directories.  You also @emph{@strong{may}} store a @geindex file tag
@dfn{file tag} (the "logical name"
of a file) @emph{in} any file.  If you don't explicitly tag a file, and use
an implicit inventory, @code{arch} will search for those embedded tags and
use them to precisely detect new files, deleted files, and renamed
files.


Each of the three options is called a @geindex tagging method
@dfn{tagging method}.


There is some advice at the end of this chapter about how to choose
among the three tagging methods.




@need 3200

@node Specifying a Tagging Method
@section Specifying a Tagging Method

@geindex tagging-method



If you never explicitly specify a tagging method, @code{arch} will use
simple naming conventions, by default.  You can also make explicit
your choice to use only naming conventions with this command issued in
a project tree:

@example
@group
        % larch tagging-method names
@end group
@group
@end group
@end example

Similarly, to use either an implicit or explicit inventory, use one of
the commands:

@example
@group
        % larch tagging-method explicit
        % larch tagging-method implicit
@end group
@group
@end group
@end example

To find out what method a given project tree uses, use the same
command with no argument:

@example
@group
        % larch tagging-method
        names
@end group
@group
@end group
@end example



@need 3200

@node The inventory Command
@section The inventory Command

@geindex naming conventions



The command @code{larch inventory} is used to print a list of source files.
It has many options, including options to print other kinds of file
lists (such as a list of all editor backup files, or a list of all
files which are not source):

@example
@group
        % cd source-tree
@end group
@group
@end group
@end example
@example
@group
        % larch inventory --source
        hello.c
        hello.h
        library
        library/buffer.c
        library/buffer.h
        ...
@end group
@group
@end group
@end example

@noindent
contrasted with:

@example
@group
        % cd source-tree
@end group
@group
@end group
@end example
@example
@group
        % ls
        hello.c   hello.c.~1~   hello.h  library
@end group
@group
@end group
@end example

(Notice that @code{hello.c.~1~} is not included in the inventory of
source files.)


The naming conventions used by @code{arch} are as follows:


@strong{Control Files} A @geindex control file
@dfn{control file} @emph{is} part of the source, but control
files are not included in the output of @code{larch inventory} unless the
@code{--all} flag is used.  Control file and directory names match any of
these patterns:

@example
@group
        .arch-project-tree
        .arch-ids
        .owned.*
        .common
        @{arch@}
@end group
@group
@end group
@end example

@strong{Junk Files} A @geindex junk file
@dfn{junk file} is @emph{not} part of the source.  A junk file
or directory name matches the pattern:

@example
@group
        ,*
@end group
@group
@end group
@end example

@noindent
or if it contains any of the characters:

@example
@group
        <space>
        <tab>
        <newline>
        [
        ]
@end group
@group
@end group
@end example
@example
@group
        ?
        \
@end group
@group
@end group
@end example

Note that if a directory name matches that pattern, then none of the
contents of the directory are part of the source, regardless of their
names.


Junk files are listed by the command:

@example
@group
        % larch inventory --junk
@end group
@group
@end group
@end example

Arch sometimes creates junk files and directories of its own.  When it
does, those files and directories have names that match the pattern:

@example
@group
        ,,*
@end group
@group
@end group
@end example

You should avoid creating files and directories with names that match
that pattern.  @code{arch} will freely delete files and directories with
names that match @code{,,*} whenever it needs to re-use such a name.


Usually, @code{arch} will delete any junk file it creates before the
command that created the junk file terminates.  Sometimes, though,
when a command fails, @code{arch} will leave behind junk files or
directories matching @code{,,*}.  This is a debugging feature, likely to be
removed in a future release.  For now, whenever you find such a file
(and are confident it isn't being used by a currently running
command), you are free to delete it.


@strong{Backup Files} If a file is not a junk file, it may be a @geindex backup
file
@dfn{backup
file}.  Backup files are not part of the source.  They match any of
the patterns:

@example
@group
      *~
      *.bak
      *.modified
      *.orig
      *.original
      *.rej
      *.rejects
@end group
@group
@end group
@end example

Backup files are listed by the command:

@example
@group
        % larch inventory --backups
@end group
@group
@end group
@end example

@strong{Precious Files} If a file is not a control file, junk file, or backup
file, it might be a @geindex precious file
@dfn{precious file}.  Precious files are not part of
the source, but @code{arch} does sometimes treat them specially.  For
example, when @code{arch} copies a directory of source for you, it copies
not only the source files, but the precious files as well.


Precious files and directories match one of these patterns:

@example
@group
        +*
        .gdbinit
        =build*
        =install*
        CVS
        RCS
        TAGS
@end group
@group
@end group
@end example

Of course, precious files can be listed by the command:

@example
@group
        % larch inventory --precious
@end group
@group
@end group
@end example

Sometimes @code{arch} will create its own precious files -- usually to save
some information that you might not want to lose.  When it does, it
creates a file or directory matching the pattern:

@example
@group
        ++*
@end group
@group
@end group
@end example

You should avoid creating such filenames yourself.  @code{arch} won't every
delete such a file -- but if one happens to get in the way of an
@code{arch} command, that command will fail with an error.


@strong{Source Files} If a file is not a control, junk, backup, or precious
file, it might be an ordinary @geindex source file
@dfn{source file}.  Source files are, of
course, the files that @code{arch} stores in an archive (along with control
files).


Source files must match the pattern:

@example
@group
        [=a-zA-Z0-9]*
@end group
@group
@end group
@end example

@noindent
but must @emph{not} match any of the patterns:

@example
@group
      *.o
      *.core
      core
@end group
@group
@end group
@end example

Ordinary source files are listed by:

@example
@group
        % larch inventory --source
@end group
@group
@end group
@end example

Some files which are @code{arch} control files are counted as source even
though they don't match the patterns above.  However, these files are
not listed by default.  All source files (ordinary source plus control
files) are listed by:

@example
@group
        % larch inventory --source --all
@end group
@group
@end group
@end example

@strong{Unrecognized Files}  Any file that doesn't fall into the above
categories is an @geindex unrecognized file
@dfn{unrecognized file}.  Unrecognized files can be
listed by the command:

@example
@group
       % larch inventory --unrecognized
@end group
@group
@end group
@end example

@strong{WARNING} The basic pattern for source files is:

@example
@group
        [=a-zA-Z]*
@end group
@group
@end group
@end example

@noindent
however, you should restrict yourself to file names that do not
contain spaces.  Filenames containing spaces are likely to trigger
bugs in the current release of @code{arch}.




@need 3200

@node Using an Explicit Inventory
@section Using an Explicit Inventory

@geindex explicit inventories

@geindex add

@geindex delete

@geindex move



If you want to use explicit designation of source filess, rather than
naming conventions alone, then use this command:

@example
@group
        % larch tagging-method explicit
@end group
@group
@end group
@end example

Note that you must use that command from within a working directory
tree that has already been initialized using @code{init}.


When using explicit designation, it is (ordinarilly) necessary to add
every file and directory in the source to the explicit list using the
command:

@example
@group
        % larch add FILE
@end group
@group
@end group
@end example

If @code{FILE} is a directory, that will create @code{FILE/.arch_ids/=id}.  If
it is a regular file or symbolic link, it will create (in the same
directory) @code{.arch_ids/FILE.id}.  In either case, the file created will
contain an obscure string known as an "inventory tag" (inventory
tags are explained in more detail below).


If you remove a regular file or symbolic link, you must use the
command:

@example
@group
        % larch delete FILE
@end group
@group
@end group
@end example

That won't remove @code{FILE} itself, but it will remove the inventory tag
for @code{FILE}.


In order to remove a directory, you must yourself remove the
@code{.arch_ids} subdirectory.  That will also implicitly remove the
inventory tags of any files that @code{arch} thinks are stored in that
directory.


If you rename a regular file or symbolic link, you can use the
command:

@example
@group
        % larch move OLD-NAME NEW-NAME
@end group
@group
@end group
@end example

@noindent
to move the inventory tag for that file.


If you rename a directory, it's inventory tag (and the tags for all
files and subdirectories it contains) move with it automatically
(because the @code{.arch_ids} subdirectory has moved).


When you run @code{larch inventory} in a working directory using explicit
designation, only explicitly designated source files are listed. 
If you would rather see a list of all files passing the naming
conventions for source files, use:

@example
@group
        % larch inventory --source --names
@end group
@group
@end group
@end example

You should also read about @code{tree-lint} later in this chapter.




@need 3200

@node Using an Implicit Inventory
@section Using an Implicit Inventory

@geindex implicit inventories



To use implicit tagging, use the following command in your working
directory:

@example
@group
        % larch tagging-method implicit
@end group
@group
@end group
@end example

When implicit tagging is used, every file that passes the naming
conventions is treated as source.  If a file or directory has an
explicit tag (created with @code{add}), @code{arch} will use that explicit
tag to recognize when a file has moved.  If a file (but not a
directory or symbolic link) lacks an explicit tag, @code{arch} will look
for a tag in the file itself.


A tag within a file has one of two forms.  It may be either:

@example
@group
        <punct><basename><spaces>-<spaces><tag>
@end group
@group
@end group
@end example

@noindent
where @code{<punct>} is an arbitrary string of punctuation and spaces,
@code{<basename>} is the basename of the file, and @code{<tag>} an inventory tag
for the file.  Or:

@example
@group
        <punct>tag:<spaces><tag>
@end group
@group
@end group
@end example

In either case, @code{<tag>} should be unique among the files within a
directory.  A tag within a file must occur within the first @code{1024} bytes
of the file.


A handy convention for source files is to add a comment to the top of
every file, briefly stating the purpose of the file:

@example
@group
        /* hello.c - `main' for the hello world program
...
@end group
@group
@end group
@end example

@noindent
or:

@example
@group
        /* tag: `main' for the hello world program
...
@end group
@group
@end group
@end example

Another possible convention is to use a string identifying the author
and the time the file was first created (or first tagged):

@example
@group
        /* tag: joe.hacker@@gnu.org Thu Nov 29 17:25:15 PST 2001
...
@end group
@group
@end group
@end example

If you use the @code{basename} form of an implicit tag, and actually rename
a file (rather than simply move it between directories), you do need
to remember to update the tag line to reflect the new basename.


When you use implicit tagging, it is ok if a file lacks any tag at
all, either explicit or implicit.  In that case, if you rename the
file, @code{arch} will think you've deleted the old file and added a new
one -- but aside from that, everything will work normally.


@strong{CAUTION:} Leading and trailing spaces around an inventory tag are
not considered part of the tag.  Within a tag, every non-graphical
character is replaced by @code{_}.  For example, you write the that tag:

@example
@group
        `main' for the hello    world program
@end group
@group
@end group
@end example

@noindent
the actual inventory tag is:

@example
@group
        `main'_for_the_hello____world_program
@end group
@group
@end group
@end example

It is possible that a future release of @code{arch} will slightly change
the rule -- so that multiple spaces and tabs are replaced by a single
@code{_}.




@need 3200

@node Recognizing Renames -- Inventory Tags
@section Recognizing Renames -- Inventory Tags

@geindex recognizing renames

@geindex renaming files



If you are using naming conventions only to recognize source files,
then if you rename a directory or file, @code{arch} will conclude that you
have deleted the old file, and created a new file.


If you are using an explicit source inventory, @code{arch} will always
recognize when a directory is renamed (presuming that the @code{.arch_ids}
subdirectory is preserved), and it will recognize when a file is
renamed if you use @code{move} (rather than @code{delete} and @code{add}).
Of course, @code{arch} can be fooled if you swap two files without swapping
their inventory tags.


If you are using an implicit inventory, @code{arch} will never recognize
when an untagged file is renamed (it will think "delete" and
"add").  If a file is tagged explicitly, @code{arch} will recognize when
the file is added, deleted, or renamed -- just as when using an
explicit inventory.  If a file is not tagged explicitly, but has an
embedded tag, @code{arch} will recognize when the file is added, deleted or
moved.




@need 3200

@node Keeping Things Neat and Tidy
@section Keeping Things Neat and Tidy

@geindex tree-lint



The command:

@example
@group
        % larch tree-lint
@end group
@group
@end group
@end example

@noindent
is useful for keeping things neat and tidy.


If you use explicit tagging, it will tell you of any tags for which
the corresponding file does not exist.  It will tell you of any files
that pass the naming conventions, but for which no explicit tag
exists.


If you use implicit tagging, it will tell you of any files for which
no tag can be found -- either explicit or implicit.  It will tell you
of any explicit tags for which the corresponding file does not exist.


In either case, or if you are using naming conventions only,
@code{tree-lint} will tell you of any files that don't fit the naming
conventions at all.


Finally, if you use explicit or implicit tagging, @code{tree-lint} will
check for cases where multiple files use the same tag.  If any two
files do have the same tag, you @emph{@strong{must}} correct that, either by
editting the tag (if it is in the file itself) or by using @code{delete}
and @code{add} to replace a duplicated explicit tag.




@need 3200

@node Avoiding Accidental Ommissions and Additions
@section Avoiding Accidental Ommissions and Additions

@geindex set-manifest

@geindex manifest

@geindex check-manifest



A @geindex manifest
@dfn{manifest} is an explicit list of the files you believe are
@emph{@strong{supposed}} to be in a project tree.  @code{arch} allows you to maintain a
manifest, and to compare it to the actual contents of a tree.


The command @code{set-manifest} sets the manifest to the current contents
of the project tree:

@example
@group
        % larch set-manifest
@end group
@group
@end group
@end example

Note that only regular source files, not @code{arch} control files, are
included in the manifest.  To replace an existing manifest, you must
provide the @code{-f} flag (or @code{--force}) to @code{set-manifest}.


You can retrieve the manifest with:

@example
@group
        % larch manifest
@end group
@group
@end group
@end example

Each line of the manifest is of the form:

@example
@group
        <path>\t<tag>
@end group
@group
@end group
@end example

@noindent
and the list is sorted by the @code{<tag>} field.


You can look for missing, added, or renamed files with:

@example
@group
        % larch check-manifest
@end group
@group
@end group
@end example

@noindent
which will compare the project tree inventory to the manifest and
print a report describing divergences (if there are any).




@need 3200

@node The Inventory Tag Abstraction in Detail
@section The Inventory Tag Abstraction in Detail

When @code{arch} considers the files and directories in a working directory
it builds a one-to-one index mapping path names (relative to the root
of the working directory tree) to @geindex inventory tags
@dfn{inventory tags}.


The inventory tag of a file is its "logical identity".  The path is
the position of that identity within the particular working dir.


You can see the inventory tag for each source file with the command:

@example
@group
        % larch inventory --source --tags
@end group
@group
@end group
@end example

When @code{arch} compares two project trees, it bases the comparison on
logical identities.  If both trees have a file with a particular
inventory tag, but the files are in different positions, then @code{arch}
considers the file to have been moved or renamed.  Similarly, if an
inventory tag is present in one tree, but missing in the other, then
@code{arch} considers the file to have been added or deleted.


If you use naming conventions only, the inventory tag of each file is
the same as its path.  Thus, when using the @code{names} tagging method,
@code{arch} never recognizes that a file has been moved or renamed.


When you use the @code{explicit} tagging method, inventory tags are stored
in the @code{.arch-ids} directories.  There is a file in @code{.arch-ids} for
each tagged file (and one file for the directory containing
@code{.arch-ids}), and those files contain the tags.


When you use the @code{implicit} tagging method, tags in @code{.arch-ids}
directories take precedence (if they exist).  If a file is not
explicitly tagged, @code{arch} searches for the inventory tag in the file
itself (as described earlier in the chapter).  Finally, if a file is
not tagged at all, then its path is used as the inventory tag.




@need 3200

@node A Warning About Changing Tagging Methods
@section A Warning About Changing Tagging Methods

Be cautious when changing tagging methods for directories already
checked-in to an @code{arch} revision control archive.


For example, if you change from the tagging method @code{names} to
@code{explicit}, then the inventory tag for every file will change.  @code{arch}
will think that you've deleted all of the files in the old tree, and
added all of the files in the new tree.


However, there is a work-around for this problem, described in a later
chapter.




@need 3200

@node Other Ways to Tag Files
@section Other Ways to Tag Files

@geindex explicit-default



In some situations, it isn't convenient to explicitly tag every file
or to add an implicit tag to every file.


You can supply a @geindex default tag
@dfn{default tag} for every file that doesn't have an
explicit tag with the command:

@example
@group
        % larch explicit-default TAG-PREFIX
@end group
@group
@end group
@end example

After that, every file in that directory which lacks an explicit tag
will have the tag:

@example
@group
        TAG-PREFIX__BASENAME
@end group
@group
@end group
@end example

@noindent
where @code{BASENAME} is the basename of the file.  Default tags created in
this way take precedence over implicit tags embedded in files.  You
can find out the default tag for a directory with:

@example
@group
        % larch explicit-default
        TAG-PREFIX
@end group
@group
@end group
@end example

@noindent
and remove the default with:

@example
@group
        % larch explicit-default --delete
@end group
@group
@end group
@end example

You can also specify a default tag which has @emph{lower} precedence than
implicit tags:

@example
@group
        % larch explicit-default --weak TAG-PREFIX
@end group
@group
@end group
@end example

@noindent
and view that default:

@example
@group
        % larch explicit-default --weak
@end group
@group
@end group
@end example

@noindent
or delete it:

@example
@group
        % larch explicit-default --weak --delete
@end group
@group
@end group
@end example



@need 3200

@node Telling tree-lint to Shut Up
@section Telling tree-lint to Shut Up

@geindex dont-care

@geindex explicit-default



When using implicit tags, you may sometimes have a directory with many
files that have no tag (either explicit or implicit), but not want
those files to appear in a report of untagged files generated by
@code{tree-lint}.  There are two ways to tell @code{tree-lint} to shut-up
about such files:


One is to provide a default explicit tag or weak default explicit tag
using @code{larch explicit-default}, as described above.  


The second method is to label the directory as "don't care"
directory -- which means that @code{tree-lint} shouldn't complain about
untagged files.  You can do that with:

@example
@group
        % larch explicit-default --dont-care set
@end group
@group
@end group
@end example

@noindent
or remove the "don't care" flag with:

@example
@group
        % larch explicit-default --delete --dont-care
@end group
@group
@end group
@end example

You can find out whether the "don't care" flag is set in a given
directory with:

@example
@group
        % larch explicit-default --dont-care
@end group
@group
@end group
@end example



@need 3200

@node Which Tagging Method Should You Use?
@section Which Tagging Method Should You Use?

Given the choice of the @code{names}, @code{explicit}, and @code{implicit} tagging
conventions, which one should you choose?


The @code{names} method is best for project trees that you don't control,
and for which the maintainer does not include file tags (either
explicit or implicit).  For such trees, the @code{names} method will always
work, but if you want to use the @code{explicit} or @code{implicit} method,
you'll have to add file tags yourself.


The @code{implicit} method is, in my opinion, by far the most convenient.
It is easy to get in the habit of adding a @code{tag:} line to the bottom
of each new file and doing a single @code{larch add} for each directory.
After those steps, you can rename files and directories freely --
without having to remember to tell @code{arch} in a separate command.


On the other hand, the @code{implicit} method has two limitations.  One
limitation is that you must accept the possibility of accidently
adding new files to the inventory.  Any file you create that passes
the naming conventions counts as source.  The other, closely related,
limitation is that if you use @code{implicit} inventories, you will
@emph{@strong{never}} want to compile a program in its own source directory.  When
you compile a program, that creates intermediate files and
executables.  Many of those files will almost certainly pass the
naming conventions for source -- so @code{arch} will wrongly include them
in a source inventory.  I use the @code{implicit} method, but my
@code{configure} scripts have a safeguard that causes them to refuse to
compile my programs in the source tree.


Finally, the @code{explicit} method is the only choice left if you want the
benefits of real file tags (therefore you can't use the @code{names}
method) but either insist on compiling in the source tree or can't
risk accidently adding the occasional unintended file (so you
shouldn't use @code{implicit}).




@need 3200

@node Altering the Naming Conventions
@section Altering the Naming Conventions

@strong{Note:} this is a relatively new feature, so the documentation is not
yet well integrated with the rest of the manual.


The file @code{@{arch@}/=tagging-method} defines the naming conventiosn used
for a particular project tree.  By editting that file, you can
estalish naming conventions that are different from the defaults,
which are described above.


That file can contain blank lines and comments (lines beginning with
@geindex #
@dfn{#}) and directives, one per line.  The permissable directives are:

@example
@group
        implicit
        explicit
        names
                specify the tagging method to use for this tree
@end group
@group
@end group
@end example
@example
@group
        exclude RE
        junk RE
        backup RE
        precious RE
        unrecognized RE
        source RE
                specify a regular expression to use for the indicated
                category of files.
@end group
@group
@end group
@end example

Regular expressions are specified in Posix ERE syntax (the same syntax
used by @geindex egrep
@dfn{egrep}, @geindex grep -E
@dfn{grep -E}, and @geindex awk
@dfn{awk}) and have default values which
implement the naming conventions described above.


The @code{exclude} pattern should match a subset of files matched by the
@code{source} pattern.  Files which match @code{exclude} are printed by:

@example
@group
        % larch inventory --source --all
@end group
@group
@end group
@end example

@noindent
but not printed by:

@example
@group
        % larch inventory --source
@end group
@group
@end group
@end example

Although you can define your own naming conventions, there are some
minor limitations:


The file names @code{.} and @code{..} are always ignored by @code{inventory}.


File names which contain non-printing characters, spaces, or any of
the globbing characters (@code{*}, @code{[}, @code{]}, @code{\}, @code{?}) are always placed
in the category @code{unrecognized}.  This is so that tools which operate
on project trees can safely presume that no source file has a name
that includes these characters.


File names which begin with @geindex ,,
@dfn{,,} are always placed in the category
@code{junk}.  This is so that tools which operate on a project tree can
safely destroy or create files beginning with @geindex ,,
@dfn{,,}.


The default naming conventions are given by:

@example
@group
       exclude ^(.arch-ids|\@{arch\@})$
       junk ^(,.*)$
       backup ^.*(~|\.~[0-9]+~|\.bak|\.orig|\.rej|\.original|\.modified|\.reject)$
       precious ^(\+.*|\.gdbinit|=build\.*|=install\.*|CVS|CVS\.adm|RCS|RCSLOG|SCCS|TAGS)$
       unrecognized ^(.*\.(o|a|so|core)|core)$
       source ^([_=a-zA-Z0-9].*|\.arch-ids|\@{arch\@}|\.arch-project-tree)$
@end group
@group
@end group
@end example






