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

Re: [PATCH] Test case for a problem with git add -u from subdirectory

From
PKPekka Kaitaniemi <kaitanie@cc.helsinki.fi>
Date
Feb 20, 2008, 19:31 UTC
Message-ID
<20080220193126.GA26686@localdomain>
In-Reply-To
<7vhcg35v9r.fsf@gitster.siamese.dyndns.org>
On Wed, Feb 20, 2008 at 10:37:36AM -0800, Junio C Hamano wrote:
Show 10 quoted lines
> Pekka Kaitaniemi <kaitanie@cc.helsinki.fi> writes:
> 
> > The key sentence being: "If no paths are specified, all tracked files
> > are updated."
> 
> My recollection is that the current behaviour was requested
> specifically by the users.  Although I do not remember offhand,
> the first implementation might have even been doing the whole
> tree unconditionally, and surprised users by stepping outside of
> the current subdirectory.

I was a bit confused whether it was a feature or a bug and since the documentation seemed to indicate that "git add -u" should add everything I suspected that it was a bug. Anyways, thanks for the clarification.

Show 6 quoted lines
> Sometimes I am annoyed that it does not do the whole tree
> (i.e. you have to go to the top), but some other times (which
> happens to be majority for me but it would depend on the
> project) I find the current behaviour a lot more convenient, and
> personally I do not think it is a good idea to change the
> current behaviour.

I agree. Changing the behaviour is not good since it was requested by users and implemented intentionally.

If adding all tracked files in the whole tree to the index is needed, then maybe it would be useful to add a new flag to git-add? Something like -a (as in all), or -U (really update the whole tree) might be useful option. But then again, the difference between them should also be documented clearly.

> Please send in documentation clarifications.
OK, I'll prepare a patch.
Pekka
Previous: Junio C Hamano
Message 3 of 3 in “Test case for a problem with git add -u from subdirectory”
  1. Test case for a problem with git add -u from subdirectoryPekka Kaitaniemi, Feb 20, 2008
  2. Junio C HamanoFeb 20, 2008
  3. Pekka KaitaniemiFeb 20, 2008

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.