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

Re: git-ls-files --added?

From
Jakub Narebski <jnareb@gmail.com>
Date
May 24, 2009, 08:37 UTC
Message-ID
<m3fxeudhho.fsf@localhost.localdomain>
In-Reply-To
<2cfc40320905240054j2c08da8bt4df95c6f1bc9e254@mail.gmail.com>
Jon Seymour <jon.seymour@gmail.com> writes:
Show 5 quoted lines
> Is there a reason why git-ls-files does not have an --added option?
> 
> I'd like to get a list of new files, due to be committed. Currently, I
> have to parse the output of git status to get that, but it seems like
> a reasonable function for git-ls-files.

You can use git-diff-* with --name-only and --diff-filter=A for that; you shouldn't parse result of porcelain git-status.

And there is also contrib/examples/git-commit.sh as a guideline...
-- 
Jakub Narebski
Poland
ShadeHawk on #git
Previous: Jon SeymourNext: Jon Seymour
Message 2 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.