git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Add a notice to the doc of git-ls-tree.

From
SFSteve Frécinaux <code@istique.net>
Date
Jul 20, 2008, 22:25 UTC
Message-ID
<1216592735-23789-1-git-send-email-code@istique.net>

The notice covers this behaviour: if you are in the git/ subdirectory of your repository, it will pick the tree corresponding to that directory instead of the root one if you specify the root tree object id.

Compare the output of both of those commands:
 git-ls-tree cb44e6571708aa2792c73a289d87586fe3c0c362
 git-cat-file -p cb44e6571708aa2792c73a289d87586fe3c0c362
---
 Documentation/git-ls-tree.txt |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/Documentation/git-ls-tree.txt b/Documentation/git-ls-tree.txt
index 1cdec22..7cba394 100644
--- a/Documentation/git-ls-tree.txt
+++ b/Documentation/git-ls-tree.txt
@@ -21,6 +21,10 @@ though - 'paths' denote just a list of patterns to match, e.g. so specifying
 directory name (without '-r') will behave differently, and order of the
 arguments does not matter.
 
+Note that if you give ls-tree the sha1 id of a parent of the tree
+corresponding to the directory you're in, it will resolve that tree and list
+its contents instead of listing the contents of the tree you gave.
+
 OPTIONS
 -------
 <tree-ish>::
-- 
1.5.6.2
Next: Petr Baudis
Message 1 of 20 in “Add a notice to the doc of git-ls-tree.”
  1. Add a notice to the doc of git-ls-tree.Steve Frécinaux, Jul 20, 2008
  2. Petr BaudisJul 20, 2008
  3. Steve FrécinauxJul 20, 2008
  4. Junio C HamanoJul 20, 2008
  5. Petr BaudisJul 20, 2008
  6. Documentation/git-ls-tree.txt: Add a caveat about prefixing pathspecPetr Baudis, Jul 21, 2008
  7. Junio C HamanoJul 21, 2008
  8. Petr BaudisJul 21, 2008
  9. Junio C HamanoJul 22, 2008
  10. Petr BaudisJul 22, 2008
  11. Petr BaudisJul 28, 2008
  12. Junio C HamanoJul 28, 2008
  13. Junio C HamanoJul 28, 2008
  14. Steve FrécinauxJul 21, 2008
  15. Junio C HamanoJul 20, 2008
  16. Petr BaudisJul 21, 2008
  17. Junio C HamanoJul 21, 2008
  18. Petr BaudisJul 21, 2008
  19. Junio C HamanoJul 21, 2008
  20. Petr BaudisJul 21, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.