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 'git add

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

2013-01-21 Thread Matthieu Moy
Robin Rosenberg robin.rosenb...@dewire.com 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

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

2013-01-21 Thread Junio C Hamano
Matthieu Moy matthieu@imag.fr 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

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 gits...@pobox.com wrote: Matthieu Moy matthieu@imag.fr 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',

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

2013-01-21 Thread Matthieu Moy
Piotr Krukowiecki piotr.krukowie...@gmail.com 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

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

2013-01-21 Thread Matthieu Moy
Junio C Hamano gits...@pobox.com 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

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 showed. Good point.

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 type

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 matthieu@imag.fr 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'.

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

2013-01-21 Thread Junio C Hamano
Duy Nguyen pclo...@gmail.com 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

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

2013-01-21 Thread Matthieu Moy
Jonathan Nieder jrnie...@gmail.com 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)