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

From: Pekka Kaitaniemi <[email-masked]>
Date: Wed, 20 Feb 2008 21:31:26 +0200

On Wed, Feb 20, 2008 at 10:37:36AM -0800, Junio C Hamano wrote:
> Pekka Kaitaniemi <[email-masked]> 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.

> 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