Artifact Content
Not logged in

Artifact 54b8a61928bb31f1082d03d5935b229d495874ab

File www/cmd_ls.wiki part of check-in [f15298fd4e] - Change the reference docs to embedded (still need to remove wiki versions); add the mv|rename command. by kejoki on 2008-11-12 03:46:34.

<h2>ls</h2>

The <code>ls</code><a href="#notes">*</a> command is informational, it doesn't do anything to
a checked-out project, but it tells you something about it.

A project consists of a "source tree" of "artifacts" (see <a href="doc/tip/www/concepts.wiki">Fossil concepts</a>.)
From a practical standpoint this is a set of files and directories rooted
at a main project directory.  The files that are under source control aren't
particularly distinguishable from those that aren't.  The <code>ls</code> and
<code>extra</code> commands provide this information.

<code>fossil ls</code> produces a listing of the files which are under source
control <i>and</i> their status within the repository.  The output is a simple
list of STATUS/filepath pairs on separate lines.  The status of a file will
likely be one of ADDED, UNCHANGED, UPDATED, or DELETED. <a href="#notes">*</a>

It's important to realize that this is the status <i>relative to the repository</i>,
it's the status as <b>fossil</b> sees it and has nothing to do with
filesystem status.  If you're new to source-management/version-control
systems, you'll probably get bit by this concept-bug at least once.

To really see the difference, issue an <code>ls</code> before and after doing
a <a href="wiki?name=fossil+commit"><code>commit</code></a>.  Before, the status of files may be any of the three,
but after <code>commit</code>ting changes the status will be UNCHANGED "across
the board."

By way of example, here's what I see if I <code>fossil ls</code> in the
directory where I have checked out my testing repository:
<nowiki><pre>
    $ fossil ls
    ADDED     feegboing
    UNCHANGED fossil_docs.txt
    DELETED   nibcrod
</pre></nowiki>
But if I do a simple ls, what I get is
<nowiki><pre>
    $ ls
    feegboing  fossil_docs.txt  manifest.uuid  noodle.txt
    _FOSSIL_   manifest         nibcrod
</pre></nowiki>

The <code>ls</code> command is almost, but not quite entirely, the exact
opposite of the
<a href="wiki?name=fossil+extra"><code>extra</code> command</a>.

<a name="notes">Notes:</a>
  *  If you come from the <b>Windows</b> world, it will help to know that 'ls' is the usual <b>unix</b> command for listing a directory.
  *  There are more states for a file to be in than those listed, including MISSING, EDITED, RENAMED and a couple of others.

See also: <a href="doc/tip/www/cmd_add.wiki">fossil add</a>, <a href="doc/tip/www/rm.wiki">
fossil rm</a>, <a href="doc/tip/www/cmd_extra.wiki">fossil extra</a>, 
<a href="doc/tip/www/cmd_commit.wiki">fossil commit</a>, 
<a href="doc/tip/www/concepts.wiki">Fossil concepts</a>, 
<a href="doc/tip/www/reference.wiki">Reference</a>