Hex Artifact Content
Not logged in

Artifact e857a7c526a167f28826caaad842e7c2f65fd86e:

File www/cmd_ls.wiki part of check-in [67f44bb301] - Changed URLs for embedded docs, changed comment in add.c:mv_cmd to read "does not rename" instead of "does rename" by kejoki on 2008-11-12 04:09:42.

0000: 3c 68 32 3e 6c 73 3c 2f 68 32 3e 0a 0a 54 68 65  <h2>ls</h2>..The
0010: 20 3c 63 6f 64 65 3e 6c 73 3c 2f 63 6f 64 65 3e   <code>ls</code>
0020: 3c 61 20 68 72 65 66 3d 22 23 6e 6f 74 65 73 22  <a href="#notes"
0030: 3e 2a 3c 2f 61 3e 20 63 6f 6d 6d 61 6e 64 20 69  >*</a> command i
0040: 73 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 61 6c 2c  s informational,
0050: 20 69 74 20 64 6f 65 73 6e 27 74 20 64 6f 20 61   it doesn't do a
0060: 6e 79 74 68 69 6e 67 20 74 6f 0a 61 20 63 68 65  nything to.a che
0070: 63 6b 65 64 2d 6f 75 74 20 70 72 6f 6a 65 63 74  cked-out project
0080: 2c 20 62 75 74 20 69 74 20 74 65 6c 6c 73 20 79  , but it tells y
0090: 6f 75 20 73 6f 6d 65 74 68 69 6e 67 20 61 62 6f  ou something abo
00a0: 75 74 20 69 74 2e 0a 0a 41 20 70 72 6f 6a 65 63  ut it...A projec
00b0: 74 20 63 6f 6e 73 69 73 74 73 20 6f 66 20 61 20  t consists of a 
00c0: 22 73 6f 75 72 63 65 20 74 72 65 65 22 20 6f 66  "source tree" of
00d0: 20 22 61 72 74 69 66 61 63 74 73 22 20 28 73 65   "artifacts" (se
00e0: 65 20 3c 61 20 68 72 65 66 3d 22 63 6f 6e 63 65  e <a href="conce
00f0: 70 74 73 2e 77 69 6b 69 22 3e 46 6f 73 73 69 6c  pts.wiki">Fossil
0100: 20 63 6f 6e 63 65 70 74 73 3c 2f 61 3e 2e 29 0a   concepts</a>.).
0110: 46 72 6f 6d 20 61 20 70 72 61 63 74 69 63 61 6c  From a practical
0120: 20 73 74 61 6e 64 70 6f 69 6e 74 20 74 68 69 73   standpoint this
0130: 20 69 73 20 61 20 73 65 74 20 6f 66 20 66 69 6c   is a set of fil
0140: 65 73 20 61 6e 64 20 64 69 72 65 63 74 6f 72 69  es and directori
0150: 65 73 20 72 6f 6f 74 65 64 0a 61 74 20 61 20 6d  es rooted.at a m
0160: 61 69 6e 20 70 72 6f 6a 65 63 74 20 64 69 72 65  ain project dire
0170: 63 74 6f 72 79 2e 20 20 54 68 65 20 66 69 6c 65  ctory.  The file
0180: 73 20 74 68 61 74 20 61 72 65 20 75 6e 64 65 72  s that are under
0190: 20 73 6f 75 72 63 65 20 63 6f 6e 74 72 6f 6c 20   source control 
01a0: 61 72 65 6e 27 74 0a 70 61 72 74 69 63 75 6c 61  aren't.particula
01b0: 72 6c 79 20 64 69 73 74 69 6e 67 75 69 73 68 61  rly distinguisha
01c0: 62 6c 65 20 66 72 6f 6d 20 74 68 6f 73 65 20 74  ble from those t
01d0: 68 61 74 20 61 72 65 6e 27 74 2e 20 20 54 68 65  hat aren't.  The
01e0: 20 3c 63 6f 64 65 3e 6c 73 3c 2f 63 6f 64 65 3e   <code>ls</code>
01f0: 20 61 6e 64 0a 3c 63 6f 64 65 3e 65 78 74 72 61   and.<code>extra
0200: 3c 2f 63 6f 64 65 3e 20 63 6f 6d 6d 61 6e 64 73  </code> commands
0210: 20 70 72 6f 76 69 64 65 20 74 68 69 73 20 69 6e   provide this in
0220: 66 6f 72 6d 61 74 69 6f 6e 2e 0a 0a 3c 63 6f 64  formation...<cod
0230: 65 3e 66 6f 73 73 69 6c 20 6c 73 3c 2f 63 6f 64  e>fossil ls</cod
0240: 65 3e 20 70 72 6f 64 75 63 65 73 20 61 20 6c 69  e> produces a li
0250: 73 74 69 6e 67 20 6f 66 20 74 68 65 20 66 69 6c  sting of the fil
0260: 65 73 20 77 68 69 63 68 20 61 72 65 20 75 6e 64  es which are und
0270: 65 72 20 73 6f 75 72 63 65 0a 63 6f 6e 74 72 6f  er source.contro
0280: 6c 20 3c 69 3e 61 6e 64 3c 2f 69 3e 20 74 68 65  l <i>and</i> the
0290: 69 72 20 73 74 61 74 75 73 20 77 69 74 68 69 6e  ir status within
02a0: 20 74 68 65 20 72 65 70 6f 73 69 74 6f 72 79 2e   the repository.
02b0: 20 20 54 68 65 20 6f 75 74 70 75 74 20 69 73 20    The output is 
02c0: 61 20 73 69 6d 70 6c 65 0a 6c 69 73 74 20 6f 66  a simple.list of
02d0: 20 53 54 41 54 55 53 2f 66 69 6c 65 70 61 74 68   STATUS/filepath
02e0: 20 70 61 69 72 73 20 6f 6e 20 73 65 70 61 72 61   pairs on separa
02f0: 74 65 20 6c 69 6e 65 73 2e 20 20 54 68 65 20 73  te lines.  The s
0300: 74 61 74 75 73 20 6f 66 20 61 20 66 69 6c 65 20  tatus of a file 
0310: 77 69 6c 6c 0a 6c 69 6b 65 6c 79 20 62 65 20 6f  will.likely be o
0320: 6e 65 20 6f 66 20 41 44 44 45 44 2c 20 55 4e 43  ne of ADDED, UNC
0330: 48 41 4e 47 45 44 2c 20 55 50 44 41 54 45 44 2c  HANGED, UPDATED,
0340: 20 6f 72 20 44 45 4c 45 54 45 44 2e 20 3c 61 20   or DELETED. <a 
0350: 68 72 65 66 3d 22 23 6e 6f 74 65 73 22 3e 2a 3c  href="#notes">*<
0360: 2f 61 3e 0a 0a 49 74 27 73 20 69 6d 70 6f 72 74  /a>..It's import
0370: 61 6e 74 20 74 6f 20 72 65 61 6c 69 7a 65 20 74  ant to realize t
0380: 68 61 74 20 74 68 69 73 20 69 73 20 74 68 65 20  hat this is the 
0390: 73 74 61 74 75 73 20 3c 69 3e 72 65 6c 61 74 69  status <i>relati
03a0: 76 65 20 74 6f 20 74 68 65 20 72 65 70 6f 73 69  ve to the reposi
03b0: 74 6f 72 79 3c 2f 69 3e 2c 0a 69 74 27 73 20 74  tory</i>,.it's t
03c0: 68 65 20 73 74 61 74 75 73 20 61 73 20 3c 62 3e  he status as <b>
03d0: 66 6f 73 73 69 6c 3c 2f 62 3e 20 73 65 65 73 20  fossil</b> sees 
03e0: 69 74 20 61 6e 64 20 68 61 73 20 6e 6f 74 68 69  it and has nothi
03f0: 6e 67 20 74 6f 20 64 6f 20 77 69 74 68 0a 66 69  ng to do with.fi
0400: 6c 65 73 79 73 74 65 6d 20 73 74 61 74 75 73 2e  lesystem status.
0410: 20 20 49 66 20 79 6f 75 27 72 65 20 6e 65 77 20    If you're new 
0420: 74 6f 20 73 6f 75 72 63 65 2d 6d 61 6e 61 67 65  to source-manage
0430: 6d 65 6e 74 2f 76 65 72 73 69 6f 6e 2d 63 6f 6e  ment/version-con
0440: 74 72 6f 6c 0a 73 79 73 74 65 6d 73 2c 20 79 6f  trol.systems, yo
0450: 75 27 6c 6c 20 70 72 6f 62 61 62 6c 79 20 67 65  u'll probably ge
0460: 74 20 62 69 74 20 62 79 20 74 68 69 73 20 63 6f  t bit by this co
0470: 6e 63 65 70 74 2d 62 75 67 20 61 74 20 6c 65 61  ncept-bug at lea
0480: 73 74 20 6f 6e 63 65 2e 0a 0a 54 6f 20 72 65 61  st once...To rea
0490: 6c 6c 79 20 73 65 65 20 74 68 65 20 64 69 66 66  lly see the diff
04a0: 65 72 65 6e 63 65 2c 20 69 73 73 75 65 20 61 6e  erence, issue an
04b0: 20 3c 63 6f 64 65 3e 6c 73 3c 2f 63 6f 64 65 3e   <code>ls</code>
04c0: 20 62 65 66 6f 72 65 20 61 6e 64 20 61 66 74 65   before and afte
04d0: 72 20 64 6f 69 6e 67 0a 61 20 3c 61 20 68 72 65  r doing.a <a hre
04e0: 66 3d 22 63 6d 64 5f 63 6f 6d 6d 69 74 2e 77 69  f="cmd_commit.wi
04f0: 6b 69 22 3e 3c 63 6f 64 65 3e 63 6f 6d 6d 69 74  ki"><code>commit
0500: 3c 2f 63 6f 64 65 3e 3c 2f 61 3e 2e 20 20 42 65  </code></a>.  Be
0510: 66 6f 72 65 2c 20 74 68 65 20 73 74 61 74 75 73  fore, the status
0520: 20 6f 66 20 66 69 6c 65 73 20 6d 61 79 20 62 65   of files may be
0530: 20 61 6e 79 20 6f 66 20 74 68 65 20 74 68 72 65   any of the thre
0540: 65 2c 0a 62 75 74 20 61 66 74 65 72 20 3c 63 6f  e,.but after <co
0550: 64 65 3e 63 6f 6d 6d 69 74 3c 2f 63 6f 64 65 3e  de>commit</code>
0560: 74 69 6e 67 20 63 68 61 6e 67 65 73 20 74 68 65  ting changes the
0570: 20 73 74 61 74 75 73 20 77 69 6c 6c 20 62 65 20   status will be 
0580: 55 4e 43 48 41 4e 47 45 44 20 22 61 63 72 6f 73  UNCHANGED "acros
0590: 73 0a 74 68 65 20 62 6f 61 72 64 2e 22 0a 0a 42  s.the board."..B
05a0: 79 20 77 61 79 20 6f 66 20 65 78 61 6d 70 6c 65  y way of example
05b0: 2c 20 68 65 72 65 27 73 20 77 68 61 74 20 49 20  , here's what I 
05c0: 73 65 65 20 69 66 20 49 20 3c 63 6f 64 65 3e 66  see if I <code>f
05d0: 6f 73 73 69 6c 20 6c 73 3c 2f 63 6f 64 65 3e 20  ossil ls</code> 
05e0: 69 6e 20 74 68 65 0a 64 69 72 65 63 74 6f 72 79  in the.directory
05f0: 20 77 68 65 72 65 20 49 20 68 61 76 65 20 63 68   where I have ch
0600: 65 63 6b 65 64 20 6f 75 74 20 6d 79 20 74 65 73  ecked out my tes
0610: 74 69 6e 67 20 72 65 70 6f 73 69 74 6f 72 79 3a  ting repository:
0620: 0a 3c 6e 6f 77 69 6b 69 3e 3c 70 72 65 3e 0a 20  .<nowiki><pre>. 
0630: 20 20 20 24 20 66 6f 73 73 69 6c 20 6c 73 0a 20     $ fossil ls. 
0640: 20 20 20 41 44 44 45 44 20 20 20 20 20 66 65 65     ADDED     fee
0650: 67 62 6f 69 6e 67 0a 20 20 20 20 55 4e 43 48 41  gboing.    UNCHA
0660: 4e 47 45 44 20 66 6f 73 73 69 6c 5f 64 6f 63 73  NGED fossil_docs
0670: 2e 74 78 74 0a 20 20 20 20 44 45 4c 45 54 45 44  .txt.    DELETED
0680: 20 20 20 6e 69 62 63 72 6f 64 0a 3c 2f 70 72 65     nibcrod.</pre
0690: 3e 3c 2f 6e 6f 77 69 6b 69 3e 0a 42 75 74 20 69  ></nowiki>.But i
06a0: 66 20 49 20 64 6f 20 61 20 73 69 6d 70 6c 65 20  f I do a simple 
06b0: 6c 73 2c 20 77 68 61 74 20 49 20 67 65 74 20 69  ls, what I get i
06c0: 73 0a 3c 6e 6f 77 69 6b 69 3e 3c 70 72 65 3e 0a  s.<nowiki><pre>.
06d0: 20 20 20 20 24 20 6c 73 0a 20 20 20 20 66 65 65      $ ls.    fee
06e0: 67 62 6f 69 6e 67 20 20 66 6f 73 73 69 6c 5f 64  gboing  fossil_d
06f0: 6f 63 73 2e 74 78 74 20 20 6d 61 6e 69 66 65 73  ocs.txt  manifes
0700: 74 2e 75 75 69 64 20 20 6e 6f 6f 64 6c 65 2e 74  t.uuid  noodle.t
0710: 78 74 0a 20 20 20 20 5f 46 4f 53 53 49 4c 5f 20  xt.    _FOSSIL_ 
0720: 20 20 6d 61 6e 69 66 65 73 74 20 20 20 20 20 20    manifest      
0730: 20 20 20 6e 69 62 63 72 6f 64 0a 3c 2f 70 72 65     nibcrod.</pre
0740: 3e 3c 2f 6e 6f 77 69 6b 69 3e 0a 0a 54 68 65 20  ></nowiki>..The 
0750: 3c 63 6f 64 65 3e 6c 73 3c 2f 63 6f 64 65 3e 20  <code>ls</code> 
0760: 63 6f 6d 6d 61 6e 64 20 69 73 20 61 6c 6d 6f 73  command is almos
0770: 74 2c 20 62 75 74 20 6e 6f 74 20 71 75 69 74 65  t, but not quite
0780: 20 65 6e 74 69 72 65 6c 79 2c 20 74 68 65 20 65   entirely, the e
0790: 78 61 63 74 0a 6f 70 70 6f 73 69 74 65 20 6f 66  xact.opposite of
07a0: 20 74 68 65 0a 3c 61 20 68 72 65 66 3d 22 63 6d   the.<a href="cm
07b0: 64 5f 65 78 74 72 61 2e 77 69 6b 69 22 3e 3c 63  d_extra.wiki"><c
07c0: 6f 64 65 3e 65 78 74 72 61 3c 2f 63 6f 64 65 3e  ode>extra</code>
07d0: 20 63 6f 6d 6d 61 6e 64 3c 2f 61 3e 2e 0a 0a 3c   command</a>...<
07e0: 61 20 6e 61 6d 65 3d 22 6e 6f 74 65 73 22 3e 4e  a name="notes">N
07f0: 6f 74 65 73 3a 3c 2f 61 3e 0a 20 20 2a 20 20 49  otes:</a>.  *  I
0800: 66 20 79 6f 75 20 63 6f 6d 65 20 66 72 6f 6d 20  f you come from 
0810: 74 68 65 20 3c 62 3e 57 69 6e 64 6f 77 73 3c 2f  the <b>Windows</
0820: 62 3e 20 77 6f 72 6c 64 2c 20 69 74 20 77 69 6c  b> world, it wil
0830: 6c 20 68 65 6c 70 20 74 6f 20 6b 6e 6f 77 20 74  l help to know t
0840: 68 61 74 20 27 6c 73 27 20 69 73 20 74 68 65 20  hat 'ls' is the 
0850: 75 73 75 61 6c 20 3c 62 3e 75 6e 69 78 3c 2f 62  usual <b>unix</b
0860: 3e 20 63 6f 6d 6d 61 6e 64 20 66 6f 72 20 6c 69  > command for li
0870: 73 74 69 6e 67 20 61 20 64 69 72 65 63 74 6f 72  sting a director
0880: 79 2e 0a 20 20 2a 20 20 54 68 65 72 65 20 61 72  y..  *  There ar
0890: 65 20 6d 6f 72 65 20 73 74 61 74 65 73 20 66 6f  e more states fo
08a0: 72 20 61 20 66 69 6c 65 20 74 6f 20 62 65 20 69  r a file to be i
08b0: 6e 20 74 68 61 6e 20 74 68 6f 73 65 20 6c 69 73  n than those lis
08c0: 74 65 64 2c 20 69 6e 63 6c 75 64 69 6e 67 20 4d  ted, including M
08d0: 49 53 53 49 4e 47 2c 20 45 44 49 54 45 44 2c 20  ISSING, EDITED, 
08e0: 52 45 4e 41 4d 45 44 20 61 6e 64 20 61 20 63 6f  RENAMED and a co
08f0: 75 70 6c 65 20 6f 66 20 6f 74 68 65 72 73 2e 0a  uple of others..
0900: 0a 53 65 65 20 61 6c 73 6f 3a 20 3c 61 20 68 72  .See also: <a hr
0910: 65 66 3d 22 63 6d 64 5f 61 64 64 2e 77 69 6b 69  ef="cmd_add.wiki
0920: 22 3e 66 6f 73 73 69 6c 20 61 64 64 3c 2f 61 3e  ">fossil add</a>
0930: 2c 20 3c 61 20 68 72 65 66 3d 22 72 6d 2e 77 69  , <a href="rm.wi
0940: 6b 69 22 3e 0a 66 6f 73 73 69 6c 20 72 6d 3c 2f  ki">.fossil rm</
0950: 61 3e 2c 20 3c 61 20 68 72 65 66 3d 22 63 6d 64  a>, <a href="cmd
0960: 5f 65 78 74 72 61 2e 77 69 6b 69 22 3e 66 6f 73  _extra.wiki">fos
0970: 73 69 6c 20 65 78 74 72 61 3c 2f 61 3e 2c 20 0a  sil extra</a>, .
0980: 3c 61 20 68 72 65 66 3d 22 63 6d 64 5f 63 6f 6d  <a href="cmd_com
0990: 6d 69 74 2e 77 69 6b 69 22 3e 66 6f 73 73 69 6c  mit.wiki">fossil
09a0: 20 63 6f 6d 6d 69 74 3c 2f 61 3e 2c 20 0a 3c 61   commit</a>, .<a
09b0: 20 68 72 65 66 3d 22 63 6f 6e 63 65 70 74 73 2e   href="concepts.
09c0: 77 69 6b 69 22 3e 46 6f 73 73 69 6c 20 63 6f 6e  wiki">Fossil con
09d0: 63 65 70 74 73 3c 2f 61 3e 2c 20 0a 3c 61 20 68  cepts</a>, .<a h
09e0: 72 65 66 3d 22 72 65 66 65 72 65 6e 63 65 2e 77  ref="reference.w
09f0: 69 6b 69 22 3e 52 65 66 65 72 65 6e 63 65 3c 2f  iki">Reference</
0a00: 61 3e 0a                                         a>.