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

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

 



Matthieu Moy <Matthieu.Moy@xxxxxxx> 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 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 explicitely 'git add -u|-A :/' or 'git add -u|-A .', to prepare
> for the next steps:
>
> * forbid 'git add -u|-A' without filepattern (like 'git add' without
>   option)
>
> * much later, maybe, re-allow 'git add -u|-A' without filepattern, with a
>   tree-wide scope.
>
> A nice side effect of this patch is that it makes the :/ special
> filepattern easier to discover for users.

Nicely explained.

> The first step should look like this patch. The message remains vague
> about the next steps ("change in a future Git version", no mention of
> the exact change nor of the exact version in which it will happen),
> but I'm fine with refining it (perhaps this could be a 2.0 change,
> like the change to push.default?).

I think rolling big changes line these to a single version bump
would make sense, if we were to do it.

I have to wonder if "git add -p" and "git add -e" are the ones that
are broken, and the migration suggested here is going in the wrong
direction, though.  After all "add -p" and "add -e" are interactive
by their nature, so it is a _lot_ easier to change their default
behaviour in the name of "usability fix", "consistency fix", or
whatever.  Wouldn't we achieve the same consistency across modes of
"add" if we made them relative to the current directory?
--
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]