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

Misleading documentation for git-diff-files (diff-filter)

From
JCJohn Cheng <johnlicheng@gmail.com>
Date
Jan 3, 2018, 16:07 UTC
Message-ID
<CAJzZBAT--X8GXg_knege_pZ8A=_Qk9nyMCLaoRMvjhUFGQYsZA@mail.gmail.com>

I originally asked this question on stackoverflow (https://stackoverflow.com/q/48039277).

I wanted to know if git diff-files shows files that are not in the index but are in the working tree. The documentation says you can supply --diff-filter=A, which will select file "that are added". However, git-diff-files (appears) to never show any files with the status of "A".

It seems like the cause is that git diff-files includes diff-options.txt which uses a standard template for --diff-filter which includes the "A" option. Perhaps a clarification can be added?

Compares the files in the working tree and the index. When paths are specified, compares only those named paths. Otherwise all entries in the index are compared. The output format is the same as for 'git diff-index' and 'git diff-tree'. Files not in the index are not compared.

-- 
---
John L Cheng
Next: Junio C Hamano
Message 1 of 6 in “Misleading documentation for git-diff-files (diff-filter)”
  1. John ChengJan 3, 2018
  2. Junio C HamanoJan 3, 2018
  3. John ChengJan 4, 2018
  4. Jeff KingJan 4, 2018
  5. Junio C HamanoJan 4, 2018
  6. John ChengJan 4, 2018

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.