2005-05-10 23:32:30 +02:00
|
|
|
git-ls-tree(1)
|
|
|
|
==============
|
|
|
|
|
|
|
|
NAME
|
|
|
|
----
|
2007-01-19 00:53:37 +01:00
|
|
|
git-ls-tree - List the contents of a tree object
|
2005-05-10 23:32:30 +02:00
|
|
|
|
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
--------
|
2006-06-07 21:46:55 +02:00
|
|
|
[verse]
|
2008-06-30 08:09:04 +02:00
|
|
|
'git ls-tree' [-d] [-r] [-t] [-l] [-z]
|
2010-10-08 19:31:15 +02:00
|
|
|
[--name-only] [--name-status] [--full-name] [--full-tree] [--abbrev[=<n>]]
|
|
|
|
<tree-ish> [<path>...]
|
2005-05-10 23:32:30 +02:00
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
-----------
|
2005-12-05 00:31:08 +01:00
|
|
|
Lists the contents of a given tree object, like what "/bin/ls -a" does
|
2008-07-28 11:33:33 +02:00
|
|
|
in the current working directory. Note that:
|
|
|
|
|
|
|
|
- the behaviour is slightly different from that of "/bin/ls" in that the
|
2010-10-08 19:31:15 +02:00
|
|
|
'<path>' denotes just a list of patterns to match, e.g. so specifying
|
2008-07-28 11:33:33 +02:00
|
|
|
directory name (without '-r') will behave differently, and order of the
|
|
|
|
arguments does not matter.
|
|
|
|
|
2010-10-08 19:31:15 +02:00
|
|
|
- the behaviour is similar to that of "/bin/ls" in that the '<path>' is
|
2008-07-28 11:33:33 +02:00
|
|
|
taken as relative to the current working directory. E.g. when you are
|
|
|
|
in a directory 'sub' that has a directory 'dir', you can run 'git
|
|
|
|
ls-tree -r HEAD dir' to list the contents of the tree (that is
|
|
|
|
'sub/dir' in 'HEAD'). You don't want to give a tree that is not at the
|
2010-01-07 17:49:12 +01:00
|
|
|
root level (e.g. `git ls-tree -r HEAD:sub dir`) in this case, as that
|
2008-07-28 11:33:33 +02:00
|
|
|
would result in asking for 'sub/sub/dir' in the 'HEAD' commit.
|
2008-12-31 11:00:50 +01:00
|
|
|
However, the current working directory can be ignored by passing
|
|
|
|
--full-tree option.
|
2005-05-10 23:32:30 +02:00
|
|
|
|
|
|
|
OPTIONS
|
|
|
|
-------
|
|
|
|
<tree-ish>::
|
2005-08-05 17:05:02 +02:00
|
|
|
Id of a tree-ish.
|
2005-05-10 23:32:30 +02:00
|
|
|
|
[PATCH] Rewrite ls-tree to behave more like "/bin/ls -a"
This is a complete rewrite of ls-tree to make it behave more
like what "/bin/ls -a" does in the current working directory.
Namely, the changes are:
- Unlike the old ls-tree behaviour that used paths arguments to
restrict output (not that it worked as intended---as pointed
out in the mailing list discussion, it was quite incoherent),
this rewrite uses paths arguments to specify what to show.
- Without arguments, it implicitly uses the root level as its
sole argument ("/bin/ls -a" behaves as if "." is given
without argument).
- Without -r (recursive) flag, it shows the named blob (either
file or symlink), or the named tree and its immediate
children.
- With -r flag, it shows the named path, and recursively
descends into it if it is a tree.
- With -d flag, it shows the named path and does not show its
children even if the path is a tree, nor descends into it
recursively.
This is still request-for-comments patch. There is no mailing
list consensus that this proposed new behaviour is a good one.
The patch to t/t3100-ls-tree-restrict.sh illustrates
user-visible behaviour changes. Namely:
* "git-ls-tree $tree path1 path0" lists path1 first and then
path0. It used to use paths as an output restrictor and
showed output in cache entry order (i.e. path0 first and then
path1) regardless of the order of paths arguments.
* "git-ls-tree $tree path2" lists path2 and its immediate
children but having explicit paths argument does not imply
recursive behaviour anymore, hence paths/baz is shown but not
paths/baz/b.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-28 09:05:38 +02:00
|
|
|
-d::
|
2005-12-05 00:31:08 +01:00
|
|
|
Show only the named tree entry itself, not its children.
|
[PATCH] Rewrite ls-tree to behave more like "/bin/ls -a"
This is a complete rewrite of ls-tree to make it behave more
like what "/bin/ls -a" does in the current working directory.
Namely, the changes are:
- Unlike the old ls-tree behaviour that used paths arguments to
restrict output (not that it worked as intended---as pointed
out in the mailing list discussion, it was quite incoherent),
this rewrite uses paths arguments to specify what to show.
- Without arguments, it implicitly uses the root level as its
sole argument ("/bin/ls -a" behaves as if "." is given
without argument).
- Without -r (recursive) flag, it shows the named blob (either
file or symlink), or the named tree and its immediate
children.
- With -r flag, it shows the named path, and recursively
descends into it if it is a tree.
- With -d flag, it shows the named path and does not show its
children even if the path is a tree, nor descends into it
recursively.
This is still request-for-comments patch. There is no mailing
list consensus that this proposed new behaviour is a good one.
The patch to t/t3100-ls-tree-restrict.sh illustrates
user-visible behaviour changes. Namely:
* "git-ls-tree $tree path1 path0" lists path1 first and then
path0. It used to use paths as an output restrictor and
showed output in cache entry order (i.e. path0 first and then
path1) regardless of the order of paths arguments.
* "git-ls-tree $tree path2" lists path2 and its immediate
children but having explicit paths argument does not imply
recursive behaviour anymore, hence paths/baz is shown but not
paths/baz/b.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-28 09:05:38 +02:00
|
|
|
|
2005-05-10 23:32:30 +02:00
|
|
|
-r::
|
2005-12-05 00:31:08 +01:00
|
|
|
Recurse into sub-trees.
|
|
|
|
|
|
|
|
-t::
|
|
|
|
Show tree entries even when going to recurse them. Has no effect
|
|
|
|
if '-r' was not passed. '-d' implies '-t'.
|
2005-05-10 23:32:30 +02:00
|
|
|
|
2007-05-19 22:08:11 +02:00
|
|
|
-l::
|
|
|
|
--long::
|
|
|
|
Show object size of blob (file) entries.
|
|
|
|
|
2005-05-10 23:32:30 +02:00
|
|
|
-z::
|
2005-12-05 00:31:08 +01:00
|
|
|
\0 line termination on output.
|
|
|
|
|
|
|
|
--name-only::
|
|
|
|
--name-status::
|
|
|
|
List only filenames (instead of the "long" output), one per line.
|
2005-05-10 23:32:30 +02:00
|
|
|
|
2006-03-07 14:52:02 +01:00
|
|
|
--abbrev[=<n>]::
|
|
|
|
Instead of showing the full 40-byte hexadecimal object
|
2009-01-12 21:02:07 +01:00
|
|
|
lines, show only a partial prefix.
|
2006-03-07 14:52:02 +01:00
|
|
|
Non default number of digits can be specified with --abbrev=<n>.
|
|
|
|
|
2006-06-07 21:46:55 +02:00
|
|
|
--full-name::
|
2006-06-08 01:29:36 +02:00
|
|
|
Instead of showing the path names relative to the current working
|
2006-06-07 21:46:55 +02:00
|
|
|
directory, show the full path names.
|
|
|
|
|
2008-12-31 11:00:50 +01:00
|
|
|
--full-tree::
|
|
|
|
Do not limit the listing to the current working directory.
|
|
|
|
Implies --full-name.
|
|
|
|
|
2010-10-08 19:31:15 +02:00
|
|
|
[<path>...]::
|
2005-12-05 00:31:08 +01:00
|
|
|
When paths are given, show them (note that this isn't really raw
|
|
|
|
pathnames, but rather a list of patterns to match). Otherwise
|
|
|
|
implicitly uses the root level of the tree as the sole path argument.
|
[PATCH] Rewrite ls-tree to behave more like "/bin/ls -a"
This is a complete rewrite of ls-tree to make it behave more
like what "/bin/ls -a" does in the current working directory.
Namely, the changes are:
- Unlike the old ls-tree behaviour that used paths arguments to
restrict output (not that it worked as intended---as pointed
out in the mailing list discussion, it was quite incoherent),
this rewrite uses paths arguments to specify what to show.
- Without arguments, it implicitly uses the root level as its
sole argument ("/bin/ls -a" behaves as if "." is given
without argument).
- Without -r (recursive) flag, it shows the named blob (either
file or symlink), or the named tree and its immediate
children.
- With -r flag, it shows the named path, and recursively
descends into it if it is a tree.
- With -d flag, it shows the named path and does not show its
children even if the path is a tree, nor descends into it
recursively.
This is still request-for-comments patch. There is no mailing
list consensus that this proposed new behaviour is a good one.
The patch to t/t3100-ls-tree-restrict.sh illustrates
user-visible behaviour changes. Namely:
* "git-ls-tree $tree path1 path0" lists path1 first and then
path0. It used to use paths as an output restrictor and
showed output in cache entry order (i.e. path0 first and then
path1) regardless of the order of paths arguments.
* "git-ls-tree $tree path2" lists path2 and its immediate
children but having explicit paths argument does not imply
recursive behaviour anymore, hence paths/baz is shown but not
paths/baz/b.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-28 09:05:38 +02:00
|
|
|
|
2005-05-26 19:52:50 +02:00
|
|
|
|
2005-05-10 23:32:30 +02:00
|
|
|
Output Format
|
|
|
|
-------------
|
[PATCH] Rewrite ls-tree to behave more like "/bin/ls -a"
This is a complete rewrite of ls-tree to make it behave more
like what "/bin/ls -a" does in the current working directory.
Namely, the changes are:
- Unlike the old ls-tree behaviour that used paths arguments to
restrict output (not that it worked as intended---as pointed
out in the mailing list discussion, it was quite incoherent),
this rewrite uses paths arguments to specify what to show.
- Without arguments, it implicitly uses the root level as its
sole argument ("/bin/ls -a" behaves as if "." is given
without argument).
- Without -r (recursive) flag, it shows the named blob (either
file or symlink), or the named tree and its immediate
children.
- With -r flag, it shows the named path, and recursively
descends into it if it is a tree.
- With -d flag, it shows the named path and does not show its
children even if the path is a tree, nor descends into it
recursively.
This is still request-for-comments patch. There is no mailing
list consensus that this proposed new behaviour is a good one.
The patch to t/t3100-ls-tree-restrict.sh illustrates
user-visible behaviour changes. Namely:
* "git-ls-tree $tree path1 path0" lists path1 first and then
path0. It used to use paths as an output restrictor and
showed output in cache entry order (i.e. path0 first and then
path1) regardless of the order of paths arguments.
* "git-ls-tree $tree path2" lists path2 and its immediate
children but having explicit paths argument does not imply
recursive behaviour anymore, hence paths/baz is shown but not
paths/baz/b.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-28 09:05:38 +02:00
|
|
|
<mode> SP <type> SP <object> TAB <file>
|
2005-05-10 23:32:30 +02:00
|
|
|
|
2009-05-10 18:13:45 +02:00
|
|
|
Unless the `-z` option is used, TAB, LF, and backslash characters
|
2005-12-05 00:31:08 +01:00
|
|
|
in pathnames are represented as `\t`, `\n`, and `\\`, respectively.
|
2010-01-07 17:49:12 +01:00
|
|
|
This output format is compatible with what `--index-info --stdin` of
|
2009-05-10 18:14:49 +02:00
|
|
|
'git update-index' expects.
|
2005-10-15 06:56:46 +02:00
|
|
|
|
2007-05-19 22:08:11 +02:00
|
|
|
When the `-l` option is used, format changes to
|
|
|
|
|
|
|
|
<mode> SP <type> SP <object> SP <object size> TAB <file>
|
|
|
|
|
|
|
|
Object size identified by <object> is given in bytes, and right-justified
|
|
|
|
with minimum width of 7 characters. Object size is given only for blobs
|
|
|
|
(file) entries; for other entries `-` character is used in place of size.
|
|
|
|
|
2005-05-10 23:32:30 +02:00
|
|
|
GIT
|
|
|
|
---
|
2008-06-06 09:07:32 +02:00
|
|
|
Part of the linkgit:git[1] suite
|