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

[bug] git-ls-files sometimes does not list files with pathspec magic ":(exclude)"

From
THThomas Haller <thaller@redhat.com>
Date
Jan 13, 2021, 17:41 UTC
Message-ID
<e2dbe996f6a7285fe0487e34d65eccf712867547.camel@redhat.com>
Hi,

It seems git-ls-files has an issue together with certain ":(exclude)" tags.

For example, on NetworkManager's git tree (top-level directory) I run
  git ls-files -- src/platform/ ":(exclude)shared/n-acd"

which wrongly lists not files. It seems to be some relation between the exclude and the search path because a different path/exclude does not exhibit the problem.

I also tested current git-master (72c4083ddf91b489b7b7b812df67ee8842177d98) which has the same issue.

Here is a reproducer (in a container run on Fedora 33/x86_64):
  podman run -ti alpine:latest \
    sh -c '
      apk add git &&
      git clone https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git &&
      cd NetworkManager &&
      git checkout -B tmp cd754680a6a0e35b286d4157269053ccc3996a32 &&
      echo ">>>>>>now BAD1..." &&
      git ls-files -- src/platform/ ":(exclude)shared/n-acd"
      echo ">>>>>>now GOOD1..." &&
      git ls-files -- src/platform/ ":(exclude)shared/c-list"
      echo ">>>>>>now GOOD2..." &&
      git ls-files -- src/platform ":(exclude)shared/n-acd"
      echo ">>>>>>now GOOD3..." &&
      git ls-files -- src/vpn/ ":(exclude)shared/n-acd"
   '

Note that only the first call in the reproducer has the unexpected result.

best, Thomas

Next: Junio C Hamano
Message 1 of 3 in “[bug] git-ls-files sometimes does not list files with pathspec magic ":(exclude)"”
  1. Thomas HallerJan 13, 2021
  2. Junio C HamanoJan 14, 2021
  3. Jeff KingJan 14, 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.