All of lore.kernel.org
 help / color / mirror / Atom feed
* let git-ls-files suppress the expanding of all files in sub directory
@ 2022-06-30  6:14 lilinchao
  2022-06-30 23:04 ` Erik Cervin Edin
  0 siblings, 1 reply; 3+ messages in thread
From: lilinchao @ 2022-06-30  6:14 UTC (permalink / raw)
  To: git

As subject said, is this possible for git-ls-files to work like this?:
" $ git ls-files --no-recursion
    a.txt
    b.txt
    dir/
"
instead of:
" $ git ls-files 
    a.txt
    b.txt
    dir/one/two/1.txt
    dir/one/two/2.txt
    dir/one/3.txt
    dir/4.txt
"

Does it make sense?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: let git-ls-files suppress the expanding of all files in sub directory
  2022-06-30  6:14 let git-ls-files suppress the expanding of all files in sub directory lilinchao
@ 2022-06-30 23:04 ` Erik Cervin Edin
  2022-06-30 23:49   ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Erik Cervin Edin @ 2022-06-30 23:04 UTC (permalink / raw)
  To: lilinchao; +Cc: git

On Thu, Jun 30, 2022, 8:26 AM lilinchao@oschina.cn <lilinchao@oschina.cn> wrote:
>
> As subject said, is this possible for git-ls-files to work like this?:
> " $ git ls-files --no-recursion
>     a.txt
>     b.txt
>     dir/
> "

An alternative
  git ls-tree --name-only HEAD
is suggested here
https://stackoverflow.com/a/10453994

Maybe that works?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: let git-ls-files suppress the expanding of all files in sub directory
  2022-06-30 23:04 ` Erik Cervin Edin
@ 2022-06-30 23:49   ` Junio C Hamano
  0 siblings, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2022-06-30 23:49 UTC (permalink / raw)
  To: Erik Cervin Edin; +Cc: lilinchao, git

Erik Cervin Edin <erik@cervined.in> writes:

> On Thu, Jun 30, 2022, 8:26 AM lilinchao@oschina.cn <lilinchao@oschina.cn> wrote:
>>
>> As subject said, is this possible for git-ls-files to work like this?:
>> " $ git ls-files --no-recursion
>>     a.txt
>>     b.txt
>>     dir/
>> "
>
> An alternative
>   git ls-tree --name-only HEAD
> is suggested here
> https://stackoverflow.com/a/10453994

The index may have different contents from HEAD, so it won't be a
replacement in general.

The index is a flat list of paths, so it is not like you can
suppressing the expansion (to avoid extra work).  You have to do
more work to omit paths in subdirectories to create such output.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-06-30 23:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-30  6:14 let git-ls-files suppress the expanding of all files in sub directory lilinchao
2022-06-30 23:04 ` Erik Cervin Edin
2022-06-30 23:49   ` Junio C Hamano

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.