# Why git-ls-tree has no --stdin option?

3 messages from 2006-08-18 to 2006-08-18. Participants: Jakub Narebski, Junio C Hamano.
Thread: https://gitlist.dev/t/5321

## Jakub Narebski, 2006-08-18 10:40

Subject: Why git-ls-tree has no --stdin option?
Message-ID: <ec45ca$id8$1@sea.gmane.org>
URL: https://gitlist.dev/e/ec45ca%24id8%241%40sea.gmane.org

```
Why git-ls-tree has no --stdin option to give <tree-ish> (feed it from
git-ref-list for example), like git-diff-tree has? The output format could
be similar: treeish, then git-ls-tree output, treeish, tree,...

Also, is there a combination of options which would display only exact
matches to path limit, i.e. tree entry only if path is directory, and file
(blob) entry only if path is ordinary file?

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git

```

## Junio C Hamano, 2006-08-18 17:39

Subject: Re: Why git-ls-tree has no --stdin option?
Message-ID: <7v7j16aqpv.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7v7j16aqpv.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <ec45ca$id8$1@sea.gmane.org>

```
Jakub Narebski <jnareb@gmail.com> writes:

> Why git-ls-tree has no --stdin option to give <tree-ish> (feed it from
> git-ref-list for example), like git-diff-tree has? The output format could
> be similar: treeish, then git-ls-tree output, treeish, tree,...

The only reason is nobody felt need for it so far, hence nobody
bothered.  If you find it useful, go wild.

> Also, is there a combination of options which would display only exact
> matches to path limit, i.e. tree entry only if path is directory, and file
> (blob) entry only if path is ordinary file?

I probably am misunderstanding the question but an empty set is
the combination you want perhaps?

$ git ls-tree HEAD -- t Document sha1 sha1_name.c
100644 blob e9eb6ce882ea92523c9a871c7581457af2dc78c5	sha1_name.c
040000 tree 3fb2bfdfef59e4ed10f525ef10ad8b43b8bc459e	t

```

## Jakub Narebski, 2006-08-18 17:44

Subject: Re: Why git-ls-tree has no --stdin option?
Message-ID: <ec4ual$9k8$1@sea.gmane.org>
URL: https://gitlist.dev/e/ec4ual%249k8%241%40sea.gmane.org
In-Reply-To: <7v7j16aqpv.fsf@assigned-by-dhcp.cox.net>

```
Junio C Hamano wrote:

>> Also, is there a combination of options which would display only exact
>> matches to path limit, i.e. tree entry only if path is directory, and file
>> (blob) entry only if path is ordinary file?
> 
> I probably am misunderstanding the question but an empty set is
> the combination you want perhaps?
> 
> $ git ls-tree HEAD -- t Document sha1 sha1_name.c
> 100644 blob e9eb6ce882ea92523c9a871c7581457af2dc78c5    sha1_name.c
> 040000 tree 3fb2bfdfef59e4ed10f525ef10ad8b43b8bc459e    t

Yes, thank you very much. 

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git

```
