All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
Cc: David Aguilar <davvid@gmail.com>, git@vger.kernel.org
Subject: Re: [PATCH] add: allow users to silence Git 2.0 warnings about "add -u"
Date: Fri, 22 Feb 2013 09:30:24 -0800	[thread overview]
Message-ID: <7v621ks1cf.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <vpqd2vssnh7.fsf@grenoble-inp.fr> (Matthieu Moy's message of "Fri, 22 Feb 2013 10:32:20 +0100")

Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:

> Yes, but push.default is really different: there is a config variable,
> and we want the behavior to be configurable. In the case of "git add",
> I don't think adding a configuration option would be the right thing.
> That would mean typing "git add -u" on an account which isn't yours will
> be unpredictable *forever*.

Exactly.

>> $ git grep 'stuff' :/
>>
>> would it be too much to teach it to do:
>>
>> $ git grep -u 'stuff'
>
> "git grep" is out of the scope of this change. Yes, it is inconsistant
> with the rest of Git, but doesn't seem to surprise users as much as "git
> add -u" (for which the inconsistancy appears within the "add" command).

It is consistent with "grep", and the reason "git grep" behaves that
way is because consistency with "grep" matters more. I do not think
it is going to change.

Another is "clean", which I do not personally care too deeply about;
it being a destructive operation that is only used interactively and
occasionally), the current behaviour to limit it to the cwd is much
more sensible than making it go and touch parts of the tree that is
unrelated to cwd.

> I don't understand what you mean by "git grep -u".

I think he meant to add "git grep --full-tree" or something, and I
do not think it is going to happen when we have ":/" magic pathspec.

> As I said, I think adding a configuration option that would remain after
> 2.0 would do more harm than good. But after thinking about it, I'm not
> against an option like a boolean add.use2dot0Behavior that would:
>
> * Right now, adopt the future behavior and kill the warning
>
> * From 2.0, kill the warning without changing the bevavior
>
> * When we stop warning, disapear.

It is marginally better than David's "set once without thinking
because I read it on stackoverflow without fully understanding the
ramifications, and forget about it only to suffer when Git 2.0
happens" configuration variable, but by not much.  You can easily
imagine

	Q. Help, Git 1.8.2 is giving me this warning. What to do?
	A. Set this configuration variable. period.

and many users setting it without realizing that they are making the
operation tree-wide at the same time.  We'd want to see this answer
instead:

	A. Say "git add -u ."; you want to add changed paths in the
 	   current directory.

Another problem with use2dot0 configuration is that it would invite
people to imagine that setting it to false will keep the old
behaviour forever, which is against what you set out to do with the
patch under discussion.

  reply	other threads:[~2013-02-22 17:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-22  6:07 [PATCH] add: allow users to silence Git 2.0 warnings about "add -u" David Aguilar
2013-02-22  6:23 ` Junio C Hamano
2013-02-22  7:12   ` David Aguilar
2013-02-22  9:32     ` Matthieu Moy
2013-02-22 17:30       ` Junio C Hamano [this message]
2013-02-23  7:59         ` David Aguilar
2013-02-23  8:44           ` Junio C Hamano
2013-02-22 17:18     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7v621ks1cf.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=Matthieu.Moy@grenoble-inp.fr \
    --cc=davvid@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.