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

Re: b5227d8 changes meaning of "ls-files -x 'pattern'"

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Dec 14, 2009, 16:15 UTC
Message-ID
<4B2664AA.4050204@drmicha.warpmail.net>
In-Reply-To
<2e24e5b90912140751y5d769f15pa6782914bdb04dbd@mail.gmail.com>
Sitaram Chamarty venit, vidit, dixit 14.12.2009 16:51:
Show 13 quoted lines
> Hello,
> 
> Before b5227d8, the following two commands would produce different
> outputs (say on git.git):
> 
>     git ls-files
>     git ls-files -x '*.c'
> 
> From b5227d8 onward, they produce the same output.  The second command
> no longer excludes *.c files.
> 
> I was unable to understand the commit message completely but it sounds
> like this was intentionally changed to do this.

Yes. Generally, git commands never ignore tracked files, and this patch reintroduces this for git ls-files

Show 5 quoted lines
> I've never been real clear on ls-files, and was wondering if someone
> would be able to clarify the various ways of using it, including why
> this change was made and is there a way (using some other combination of
> flags perhaps) to get a list of files without *.c (to continue this
> example).
You can still use file glob patterns as the file argument, such as
git ls-files '*.[^c]'
Michael
Previous: Sitaram ChamartyNext: Jeff King
Message 2 of 4 in “b5227d8 changes meaning of "ls-files -x 'pattern'"”
  1. Sitaram ChamartyDec 14, 2009
  2. Michael J GruberDec 14, 2009
  3. Jeff KingDec 14, 2009
  4. Sitaram ChamartyDec 17, 2009

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.