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

Re: git-ls-files --added?

From
Junio C Hamano <gitster@pobox.com>
Date
May 24, 2009, 18:17 UTC
Message-ID
<7vmy921i3j.fsf@alter.siamese.dyndns.org>
In-Reply-To
<2cfc40320905240212jc111b1xfeb39b1851c606d3@mail.gmail.com>
Jon Seymour <jon.seymour@gmail.com> writes:
Show 6 quoted lines
> Jakub,
>
> Thanks - yes, I wasn't happy about parsing git status.
>
> I am still interested in the rationale for git-ls-files not supporting
> such an option directly, since git-diff still seems a little indirect.

Partly historical, but more fundamental reason is because ls-files plumbing is about the index.

The index by definition knows about the work tree files. Reporting the status of work tree files by comparing what was added to the index makes sense in that context.

git-ls-files documentation lists --cached/deleted... and if you think about them, you will realize that the all of them make sense; they are about the index or comparison between the index and the work tree.

Added is _not_ about comparision between the index and the work tree. It is between the HEAD commit and the index, and it does not belong to ls-files plumbing.

Previous: Jon SeymourNext: Junio C Hamano
Message 4 of 13 in “git-ls-files --added?”
  1. Jon SeymourMay 24, 2009
  2. Jakub NarebskiMay 24, 2009
  3. Jon SeymourMay 24, 2009
  4. Junio C HamanoMay 24, 2009
  5. Junio C HamanoMay 25, 2009
  6. Constantine PlotnikovMay 25, 2009
  7. Björn SteinbrinkMay 25, 2009
  8. Jon SeymourMay 26, 2009
  9. David AguilarMay 29, 2009
  10. Nanako ShiraishiMay 29, 2009
  11. Junio C HamanoMay 29, 2009
  12. David AguilarMay 30, 2009
  13. Tony FinchMay 31, 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.