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

Question about git-ls-files

From
RSRadoslaw Szkodzinski <astralstorm@o2.pl>
Date
Mar 24, 2006, 22:49 UTC
Message-ID
<200603242349.54578.astralstorm@o2.pl>
git-ls-files is a very useful command to list various types of files.
However, it has some weird behaviour.

Let's say someone removed the file and not updated the index yet. I want to get status for all files in the directory, so I launch git-ls-files -t -m -d -o, and I get:

R removed-file C removed-file ? something-else

(it looks even better if I call it w/o -t)

If the file is removed, then marking it as changed is redundant. A removed file cannot be unchanged.

This behaviour makes for slow parsing, because to get the changed files which still exist one has to at least skip items (or uniquify the list). This shouldn't be needed.

Removed files should of course still be listed as changed if there's no -d parameter.

-- 
GPG Key id:  0xD1F10BA2
Fingerprint: 96E2 304A B9C4 949A 10A0  9105 9543 0453 D1F1 0BA2

AstralStorm
Message 1 of 1 in “Question about git-ls-files”
  1. Radoslaw SzkodzinskiMar 24, 2006

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.