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

Re: Request feature: –no-submodule

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 3, 2021, 00:55 UTC
Message-ID
<xmqq8s3r7oma.fsf@gitster.g>
In-Reply-To
<YLfqiLbpPXWXHlBi@nand.local>
Taylor Blau <me@ttaylorr.com> writes:
Show 11 quoted lines
> On Wed, Jun 02, 2021 at 01:31:11PM +0300, Ilias Apostolou wrote:
>> Hello Git community.
>>
>> As you already know, git ls-files command lists all of the tracked files,
>> but submodule names are included.
>>
>> My team would like a –no-submodule switch to exclude those.
>
> In all honesty, though this seems like a niche request for ls-files to
> fulfill, ls-files already has quite the collection of options, so I
> wouldn't be sad to see it learn how to do this, too.
I would be somewhat sad for two reasons.
 - If "I am not interested in any submodule" in a project with
   submodules is a common thing people would want, teaching a trick
   only to "ls-files" is an expensive and ineffective approach, and
   adding the option to everything would just be ugly.  "git diff
   --no-submodule"?  "git add --no-submodule ."?
 - Is "not interested in any submodule" so special and fundamental,
   or is it merely because the project the original requestor is
   looking at happens to have an optional submodule? If the project
   had that optional part as a subdirectory instead, would the
   request have been not --no-submodule but something else?  What
   happens when the project that led to the original request
   acquires another submodule that is more interesting, or what if
   the requestor's interest shifts and makes some submodules
   interesting but others not?  Would the --no-submodule option
   become totally useless in such a case?

I wonder if the "attr" magic of the pathspec, that allows you to choose paths based on the attributes you set on them, is what the original requestor missed.

Previous: Taylor BlauNext: Taylor Blau
Message 3 of 12 in “Request feature: –no-submodule”
  1. Ilias ApostolouJun 2, 2021
  2. Taylor BlauJun 2, 2021
  3. Junio C HamanoJun 3, 2021
  4. Taylor BlauJun 3, 2021
  5. Ilias ApostolouJun 3, 2021
  6. Junio C HamanoJun 3, 2021
  7. Junio C HamanoJun 3, 2021
  8. Jeff KingJun 3, 2021
  9. Junio C HamanoJun 3, 2021
  10. Jeff KingJun 4, 2021
  11. Junio C HamanoJun 4, 2021
  12. Ilias ApostolouJun 5, 2021

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.