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

Re: git-ls-files --added?

From
Björn Steinbrink <b.steinbrink@gmx.de>
Date
May 25, 2009, 07:46 UTC
Message-ID
<20090525074606.GA30061@atjola.homenet>
In-Reply-To
<85647ef50905250031m375a14d9y252444a8bdc250b5@mail.gmail.com>
On 2009.05.25 11:31:42 +0400, Constantine Plotnikov wrote:
> BTW git-diff won't work in situation when the directory was just
> initialized and there were no commit. In that case added file = staged
> file and it is possible to use git-ls-files.

You can use the object name of the empty tree with diff-* in that case, that's what the pre-commit.sample hook does.

Björn
Previous: Constantine PlotnikovNext: Jon Seymour
Message 7 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.