Re: [RFC/PATCH] add: warn when -u or -A is used without filepattern

2013-01-21 Thread Matthieu Moy
Jonathan Nieder writes: > Would it be possible to make this conditional on cwd not being at the > toplevel (the case where "git add -u :/" and "git add -u ." have > different behavior)? E.g., > > static const char *here[2] = { ".", NULL }; > if (prefix) >

Re: [RFC/PATCH] add: warn when -u or -A is used without filepattern

2013-01-21 Thread Junio C Hamano
Duy Nguyen writes: > What about 'grep' and 'clean'? I think at least 'clean' should go > tree-wide default too. I don't mind grep go the same way either but I > think people voiced preference in current behavior.. I think the major argument for "git grep" to be the way it is is because people ex

Re: [RFC/PATCH] add: warn when -u or -A is used without filepattern

2013-01-21 Thread Duy Nguyen
On Mon, Jan 21, 2013 at 7:00 PM, Matthieu Moy wrote: > Most git commands that can be used with our without a filepattern are > tree-wide by default, the filepattern being used to restrict their scope. > A few exceptions are: 'git grep', 'git clean', 'git add -u' and 'git add -A'. > > The inconsist

Re: [RFC/PATCH] add: warn when -u or -A is used without filepattern

2013-01-21 Thread Jonathan Nieder
Hi, Matthieu Moy wrote: > The inconsistancy of 'git add -u' and 'git add -A' are particularly > problematic since other 'git add' subcommands (namely 'git add -p' and > 'git add -e') are tree-wide by default. > > Flipping the default now is unacceptable, so this patch starts training > users to t

Re: [RFC/PATCH] add: warn when -u or -A is used without filepattern

2013-01-21 Thread Robin Rosenberg
- Ursprungligt meddelande - > > git diff > > #looks good > > git add -u > > That's indeed the kind of mistake I'd like to avoid. In your example, > "git diff" is tree-wide, and "git add -u" is limited to ., so in > general > "git add -u" won't stage the same thing as "git diff" just sho

Re: [RFC/PATCH] add: warn when -u or -A is used without filepattern

2013-01-21 Thread Matthieu Moy
Junio C Hamano writes: > Wouldn't we achieve the same consistency across modes of > "add" if we made them relative to the current directory? As other people already said, it would be nice to have consistency accross most if not all commands. AFAICT, the only exceptions to "tree-wide by default,

Re: [RFC/PATCH] add: warn when -u or -A is used without filepattern

2013-01-21 Thread Matthieu Moy
Piotr Krukowiecki writes: > Another issue is usability. Can we definitely say which is better: add > all changes from current subdir, or add all changes from whole tree? I > don't know. Hard to tell, depending on users, use-case, ... But the good news is: whatever option is chosen, the other on

Re: [RFC/PATCH] add: warn when -u or -A is used without filepattern

2013-01-21 Thread Piotr Krukowiecki
On Mon, Jan 21, 2013 at 8:12 PM, Junio C Hamano wrote: > Matthieu Moy writes: > >> Most git commands that can be used with our without a filepattern are >> tree-wide by default, the filepattern being used to restrict their scope. >> A few exceptions are: 'git grep', 'git clean', 'git add -u' and

Re: [RFC/PATCH] add: warn when -u or -A is used without filepattern

2013-01-21 Thread Junio C Hamano
Matthieu Moy writes: > Most git commands that can be used with our without a filepattern are > tree-wide by default, the filepattern being used to restrict their scope. > A few exceptions are: 'git grep', 'git clean', 'git add -u' and 'git add -A'. > > The inconsistancy of 'git add -u' and 'git a

Re: [RFC/PATCH] add: warn when -u or -A is used without filepattern

2013-01-21 Thread Matthieu Moy
Robin Rosenberg writes: > git add -u without filepattern is, I believe very common, so no noisy > output there please. What are you exactly suggesting? That we keep the inconsistant semantics of "git add -u" or "git add -A"? Or another migration plan? > git diff > #looks good > git add -u That

Re: [RFC/PATCH] add: warn when -u or -A is used without filepattern

2013-01-21 Thread Robin Rosenberg
- Ursprungligt meddelande - > Most git commands that can be used with our without a filepattern are > tree-wide by default, the filepattern being used to restrict their > scope. > A few exceptions are: 'git grep', 'git clean', 'git add -u' and 'git > add -A'. > > The inconsistancy of 'gi

[RFC/PATCH] add: warn when -u or -A is used without filepattern

2013-01-21 Thread Matthieu Moy
Most git commands that can be used with our without a filepattern are tree-wide by default, the filepattern being used to restrict their scope. A few exceptions are: 'git grep', 'git clean', 'git add -u' and 'git add -A'. The inconsistancy of 'git add -u' and 'git add -A' are particularly problema