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, 21:54 UTC
Message-ID
<xmqqo8cm4nst.fsf@gitster.g>
In-Reply-To
<YLkr+kLdjmHyPjgl@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
> It doesn't seem outrageous to me for Git to automatically populate
> "pseudo-attributes" that connect properties of paths to the attribute
> system.

Sounds sensible. The attribute assignment was designed to purely depend on paths and not contents, so it might be a bit awkwarad to implement, but it should be doable.

Show 10 quoted lines
> An alternative view is allowing a pathspec that asks about the mode:
>
>   git ls-files ':(mode=160000)'
>
> That also lets you ask about other things, like:
>
>   git ls-files ':(mode=100755)'
>
> but it is probably unnecessarily arcane (even I had to look up the
> correct mode for a gitlink just now :) ).

The original request, as I understand the clarification posted upthread, is not "submodules are uninteresting", but is "we want regular files" (and we postprocess further the output), so such a "mode" (pseudo-)attribute that is automatically populated would be a better fit anyway. With the current system, they can already do:

    git ls-files -s ':(exclude)*.png' ':(exclude)*.ico)' |
    sed -n -e 's/^100[76][54][54] [0-9a-f]* 0       //p' |
    xargs dos2unix
(cf. <9cc98ca3-bdc5-61bf-450a-99bb47673d6c@gmail.com>)

and with such an auto-pseudo-attribute, presumably something along this line would work, removing the need for the intermediate filter:

    git ls-files \
	':(attr:mode=100755)' ':(attr:mode=100644)' \
	':(exclude)*.png' ':(exclude)*.ico' |
    xargs dos2unix
Previous: Jeff KingNext: Jeff King
Message 9 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.