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

Re: Doing a git add '' will add more files then expected

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 17, 2014, 19:08 UTC
Message-ID
<xmqqh9xxy79x.fsf@gitster.dls.corp.google.com>
In-Reply-To
<vpqa93p8y9n.fsf@anie.imag.fr>
Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:
Show 6 quoted lines
> Andreas Schwab <schwab@linux-m68k.org> writes:
>
>> The argument to git add is a pathspec, and the empty pathspec matches
>> all files.
>
> Err, why does the empty pathspec match all files? Isn't that a bug?
That is debatable.
    cd Documentation
    git add "a"
would be equivalent to typing
    git add Documentation/"a"
so
    cd Documentation
    git add ""
would be equivalent to typing
    git add Documentation/""

And doing the same from the top-level of the working tree can be argued to be a natural extension.

Previous: Matthieu MoyNext: Javier Domingo Cansino
Message 4 of 5 in “Doing a git add '' will add more files then expected”
  1. GuilhermeNov 17, 2014
  2. Andreas SchwabNov 17, 2014
  3. Matthieu MoyNov 17, 2014
  4. Junio C HamanoNov 17, 2014
  5. Javier Domingo CansinoNov 23, 2014

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.