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

Re: git add -A fails in empty repository since 1.8.5

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Dec 18, 2013, 19:24 UTC
Message-ID
<vpqvbymarnw.fsf@anie.imag.fr>
In-Reply-To
<xmqqioumhtvp.fsf@gitster.dls.corp.google.com>
Junio C Hamano <gitster@pobox.com> writes:
> It could be argued that a "git add [<any option>] .", with an
> explicit "." given by the end-user, that is run in an empty
> directory may be an error worth reporting.
But what we have right now is really weird:

# setup repo with one empty dir: $ rm -fr test $ git init test Initialized empty Git repository in /tmp/test/.git/ $ cd test $ mkdir foo

$ git add . fatal: pathspec '.' did not match any files

=> The one we're discussing.
$ git add foo
=> No error when an empty directory other than . is given.

$ cd foo $ git add .

=> No error either for "git add ." when not at the root of the repo.
-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 18 in “git add -A fails in empty repository since 1.8.5”
  1. Thomas Ferris NicolaisenDec 18, 2013
  2. Antoine PelisseDec 18, 2013
  3. Duy NguyenDec 18, 2013
  4. Junio C HamanoDec 18, 2013
  5. Matthieu MoyDec 18, 2013
  6. Junio C HamanoDec 18, 2013
  7. Junio C HamanoDec 18, 2013
  8. Duy NguyenDec 19, 2013
  9. add: don't complain when adding empty project rootNguyễn Thái Ngọc Duy, Dec 23, 2013
  10. Torsten BögershausenDec 23, 2013
  11. Duy NguyenDec 23, 2013
  12. Torsten BögershausenDec 24, 2013
  13. Duy NguyenDec 24, 2013
  14. Torsten BögershausenJan 30, 2014
  15. Junio C HamanoJan 31, 2014
  16. Jonathan NiederDec 26, 2013
  17. Junio C HamanoDec 26, 2013
  18. Junio C HamanoDec 26, 2013

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.