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

Re: svn versus git

From
Junio C Hamano <junkio@cox.net>
Date
Dec 15, 2006, 18:14 UTC
Message-ID
<7v3b7hxc05.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<4582C233.1000706@op5.se>
Andreas Ericsson <ae@op5.se> writes:
Show 16 quoted lines
>>> The number in front is octal mode of a file or directory. "blob"
>>> is a file (or symbolic link), "tree" is a directory, all of this
>>> can be found in git(7).
>>
>> I don't want to come through as rude, but that you can find the explanation
>> somewhere (and as an old(ish) Unix/git hand you know (or should be able to
>> guess easily) what it means) doesn't help the _newbie_ confronted with this
>> gibberish one iota.
>
> I think it would help if we could write out things ls-style though and
> I'm all for axing the SHA1 (I don't even think the SHA1 of specific
> files of a tree can be *used* for anything), so the above would be
>
> -rw-r--r-- Makefile
>
> which most newbies should grok fairly quickly.

'ls-tree' is a plumbing and existing scripts (not limited to what are in git.git) use it to extract object names from arbitrary trees. It's output format will NOT change.

The honest position to take on "svn list" question is "we do not have a counterpart for that command".

Now, I happen to think "getting list of all paths in one particular revision" is not a very useful operation from the end user's point of view. One possible use is to get such a list from multiple revisions and compare them with "comm -3", but that is obviously useless in the context of git. You can do that with "diff --name-status --diff-filter=AD" without doing ls-tree yourself.

But if "ls $commit" is still interesting at end-user level, probably we would need a Porcelain to let users do so.

Johannes recently made
	$ git show $commit^{tree}
to do the name-only variant.

If people actually do "ls-tree --name-only" (or ls-tree --like-ls-l) often, we might want to be even easier:

	$ git show --ls $commit
or even:
	$ git ls $commit
or even:
	[alias] ls = ls-tree --name-only
Previous: Andreas EricssonNext: Horst H. von Brand
Message 4 of 10 in “Re: git-show --stat on first commit”
  1. Horst H. von BrandNov 21, 2006
  2. Horst H. von BrandDec 15, 2006
  3. Andreas EricssonDec 15, 2006
  4. Junio C HamanoDec 15, 2006
  5. Horst H. von BrandDec 27, 2006
  6. Junio C HamanoDec 27, 2006
  7. Junio C HamanoDec 28, 2006
  8. Nicolas PitreDec 28, 2006
  9. David KågedalDec 29, 2006
  10. Horst H. von BrandJan 4, 2007

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.