git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git-add --verbose should say when something is already indexed
@ 2008-12-29  6:46 jidanni
  2008-12-29  8:52 ` Nanako Shiraishi
  0 siblings, 1 reply; 4+ messages in thread
From: jidanni @ 2008-12-29  6:46 UTC (permalink / raw)
  To: git

git-add or at least git-add --verbose should say upon
$ git-add bla.txt
$ git-add bla.txt
bla.txt is already in the index.

The git-add man page should mention how one can see all the files
added, perhaps by git-ls-files. If so mention in SEE ALSO too.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: git-add --verbose should say when something is already indexed
  2008-12-29  6:46 git-add --verbose should say when something is already indexed jidanni
@ 2008-12-29  8:52 ` Nanako Shiraishi
  2008-12-29  9:02   ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Nanako Shiraishi @ 2008-12-29  8:52 UTC (permalink / raw)
  To: jidanni; +Cc: git

Quoting jidanni@jidanni.org:

> git-add or at least git-add --verbose should say upon
> $ git-add bla.txt
> $ git-add bla.txt
> bla.txt is already in the index.

I do not think it should.

I suspect that you misunderstand what "git add" is. It is not about adding a new path to be tracked. Rather, it is to add the current contents of the file (unless --interactive is used).

You told git to add the contents of "bla.txt" to the index as path "bla.txt". I do not think there is anything more to report after it did exactly what it was told to do.

-- 
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: git-add --verbose should say when something is already indexed
  2008-12-29  8:52 ` Nanako Shiraishi
@ 2008-12-29  9:02   ` Junio C Hamano
  2008-12-29 22:55     ` jidanni
  0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2008-12-29  9:02 UTC (permalink / raw)
  To: Nanako Shiraishi; +Cc: jidanni, git

Nanako Shiraishi <nanako3@lavabit.com> writes:

> Quoting jidanni@jidanni.org:
>
>> git-add or at least git-add --verbose should say upon
>> $ git-add bla.txt
>> $ git-add bla.txt
>> bla.txt is already in the index.
>
> I do not think it should.
>
> I suspect that you misunderstand what "git add" is. It is not about adding a new path to be tracked. Rather, it is to add the current contents of the file (unless --interactive is used).
>
> You told git to add the contents of "bla.txt" to the index as path "bla.txt". I do not think there is anything more to report after it did exactly what it was told to do.

That is almost (say, 98%) true, but it is not absolutely outlandishly
unreasonable if somebody wants:

    $ git add bla.txt
    $ edit bla.txt
    $ git add bla.txt

and

    $ git add bla.txt
    $ git add bla.txt

to behave differently.  The latter is a pure no-op.

Having said that, I do not think it is worth it.  For one thing, if you
did:

    $ git add .

after making changes to a few files and created one new file in a project
with 20,000 files, command would say "Yo, bozo, you told me to add the
same contents for path X" for 19,998  times.

If the report were not negative as Jidanni suggests, but instead were
positive, i.e.

    $ git add -v frotz.txt nitfol.txt
    added new contents for frotz.txt
    added new contents for nitfol.txt
    $ edit frotz.txt
    $ git add -v frotz.txt nitfol.txt
    added new contents for frotz.txt

it might be slightly more useful, but I doubt it is that useful in
practice.

I won't reject a patch if it is cleanly done, though.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: git-add --verbose should say when something is already indexed
  2008-12-29  9:02   ` Junio C Hamano
@ 2008-12-29 22:55     ` jidanni
  0 siblings, 0 replies; 4+ messages in thread
From: jidanni @ 2008-12-29 22:55 UTC (permalink / raw)
  To: gitster; +Cc: nanako3, git

DESCRIPTION
       This command adds the current content of new or modified files to the index, thus staging that content for
       inclusion in the next commit.

Maybe also mention that it also adds a new path to be tracked by the
index, if it is not tracked already.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-12-29 22:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-29  6:46 git-add --verbose should say when something is already indexed jidanni
2008-12-29  8:52 ` Nanako Shiraishi
2008-12-29  9:02   ` Junio C Hamano
2008-12-29 22:55     ` jidanni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).