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

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

From
SFSteve Frécinaux <nudrema@gmail.com>
Date
Jul 20, 2008, 23:22 UTC
Message-ID
<f35478f50807201622n282e7eefve94ae144bfb720a7@mail.gmail.com>
In-Reply-To
<20080720230846.GH32184@machine.or.cz>
> It's hard to make out what do you mean, the patch description is much
> clearer, paradoxically.

It is hard to explain such a strange behaviour with a description that is both short and generic enough... But I agree with you. I just got bitten by this and I thought it was important enough to be specified.

Show 12 quoted lines
> Also, this in fact holds for the root tree
> instead of the parent tree, and the behaviour changes from "weird" to
> "simply broken" when you try to list a tree object that is _not_ the
> root project tree from within a subdirectory:
>
>        git$ git ls-tree HEAD Documentation
>        040000 tree 066c25e86a44d4c7bde2d3e9b91e6891d752efa1    Documentation
>        git/Documentation$ git ls-tree 066c25e86a44d4c7bde2d3e9b91e6891d752efa1
>        git/Documentation$
>
> I think that ls-tree simply shouldn't auto-fill its pathspec based on
> current prefix in case no pathspec was supplied. Patch to follow.

I also thought this behaviour was broken. But I didn't want to patch it because I was afraid of breaking things that would rely on it, despite it seems unexpected enough not to be used...

Previous: Petr BaudisNext: Junio C Hamano
Message 3 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.