Hi Matthieu,

Matthieu Moy wrote:

> --- a/builtin/add.c
> +++ b/builtin/add.c
[...]
> @@ -392,8 +420,14 @@ int cmd_add(int argc, const char **argv, const char 
> *prefix)
>               die(_("-A and -u are mutually incompatible"));
>       if (!show_only && ignore_missing)
>               die(_("Option --ignore-missing can only be used together with 
> --dry-run"));
> -     if ((addremove || take_worktree_changes) && !argc) {
> +     if (addremove)
> +             option_with_implicit_dot = "--all";
> +     if (take_worktree_changes)
> +             option_with_implicit_dot = "--update";

I agree with Junio that these are most often spelled as "-A" and "-u".

> +     if (option_with_implicit_dot && !argc) {
>               static const char *here[2] = { ".", NULL };
> +             if (prefix)
> +                     warn_pathless_add(option_with_implicit_dot);

For what it's worth, with or without s/--all/-A/ and s/--update/-u/,
Reviewed-by: Jonathan Nieder <jrnie...@gmail.com>

Thanks.  If someone wants to preserve the spelling of the option name
passed by the user, that can happen as a patch on top.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to