Re: [BUG] 'add -u' doesn't work from untracked subdir

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Clemens Buchacher <drizzd@xxxxxx> writes:

> "git add -u ." is friendly enough. Just like "git commit ." versus "git
> commit -a", which is exactly the same concept and should therefore have the
> same behavior.
>
> You are assuming that people are in a subdirectory because they want to
> limit the scope. But I am usually in a subdirectory for totally
> versioning-unrelated reasons.

Limit the scope of what you see in "ls" (no argument) output, shorten the
paths you must type to non-git commands.  They are the kind of "limit the
scope" I meant, and they are totally versioning-unrelated.  In other
words, cwd-centric default helps the users (especially the new ones) by
making git behave consistently with other commands.

So if anything, I personally think it would be much less surprising if all
git commands worked relative to the cwd (not whole tree root) when run
without path argument, at least from the newbie's point of view [*1*].

But notice that the above is qualified with "personally".  An alternative
would be to declare that in 1.8.0, all commands run without path argument
will work on the whole tree and you have to give an explicit '.' when you
want to limit their effect to the cwd.

This may be slightly less intuitive to newbies than the "relative to cwd",
but nevertheless that is the course I would suggest us taking, because of
the following observations:

 (1) if the commands work on the whole tree when run without paths, it is
     easy to limit to the cwd with "git frotz ." when you want to.

 (2) if the commands work on the cwd when run without paths, you have to
     always be aware how deep you are, and say "git frotz ../../.." when
     you want to extend their effects to the whole tree.

The latter is much more irritating.

Please also see:

    Message-ID: <7vy6ot4x61.fsf@xxxxxxxxxxxxxxxxxxxxxxxx> ($gmane/127795)

think about the three questions there, and help us move the discussion
forward.

The first part of the message has some comments related to your patch, by
the way.

[Footnote]

*1* Except for the ones that cannot make any sense to limit their
operation to a subdirectory you happen to be in (e.g. it would be insane
if "git am" run to accept somebody's patch ignored paths outside your
cwd).
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]