Jeff King [off-list ref] writes:
That would also provide people who do not like the change of default an
escape hatch to keep the current behavior. And I do not think scripted
use will be inconvenienced; they will already have to use "." or ":/" to
be explicit (if they care) since the behavior is changing.
There is a big difference between "scripted use will have an escape
hatch" and "scripted use will not be inconvenienced". We *know*
scripts will be inconvenienced with or without such a configuration
variable, as they *have* to be updated if they rely on the current
behaviour of "git grep" that limits its search to the current
directory when fed no pathspec (and if their users want to keep the
current behaviour of such scripts). Anything short of a warning (or
even erroring out) that is designed to annoy the users during the
transition period will help ease the pain of transition of scripts.
An annoying warning still can only *ease*, but cannot eliminate, the
pain of transition. The scripts need to be updated to adjust to the
new behaviour; there is no getting around to it.
Even if we ignore the "helping your colleague at her terminal", cf.
http://thread.gmane.org/gmane.comp.version-control.git/133570/focus=133683
issue for now, adding a new configuration variable from day one
makes the transition of scripts somewhat worse, I am afraid. Doing
so robs us a way to add such an annoying warning to help people
foresee problems in their existing scripts before the default
changes (the configuration presumably will disable the "this command
line will behave differently after the default changes" warning).
As I said, I think we can train people without an annoying warning,
as hits outside their current directory will serve as an annoyance
already, and people who set such a configuration in their repository
(or $HOME/.gitconfig), get used to the chosen behaviour too much,
and get surprised when they get to use a vanilla intallation of Git
(either helping colleague or setting up a new work environment) have
only themselves to blame, so it may not be too big a deal.
But I do not think the same reasoning extends to scripted uses X-<.
On Thu, Oct 24, 2013 at 12:40 PM, Junio C Hamano [off-list ref] wrote:
Jeff King [off-list ref] writes:
quoted
That would also provide people who do not like the change of default an
escape hatch to keep the current behavior. And I do not think scripted
use will be inconvenienced; they will already have to use "." or ":/" to
be explicit (if they care) since the behavior is changing.
There is a big difference between "scripted use will have an escape
hatch" and "scripted use will not be inconvenienced". We *know*
scripts will be inconvenienced with or without such a configuration
variable, as they *have* to be updated if they rely on the current
behaviour of "git grep" that limits its search to the current
directory when fed no pathspec (and if their users want to keep the
current behaviour of such scripts). Anything short of a warning (or
even erroring out) that is designed to annoy the users during the
transition period will help ease the pain of transition of scripts.
An annoying warning still can only *ease*, but cannot eliminate, the
pain of transition. The scripts need to be updated to adjust to the
new behaviour; there is no getting around to it.
Even if we ignore the "helping your colleague at her terminal", cf.
http://thread.gmane.org/gmane.comp.version-control.git/133570/focus=133683
issue for now, adding a new configuration variable from day one
makes the transition of scripts somewhat worse, I am afraid. Doing
so robs us a way to add such an annoying warning to help people
foresee problems in their existing scripts before the default
changes (the configuration presumably will disable the "this command
line will behave differently after the default changes" warning).
As I said, I think we can train people without an annoying warning,
as hits outside their current directory will serve as an annoyance
already, and people who set such a configuration in their repository
(or $HOME/.gitconfig), get used to the chosen behaviour too much,
and get surprised when they get to use a vanilla intallation of Git
(either helping colleague or setting up a new work environment) have
only themselves to blame, so it may not be too big a deal.
But I do not think the same reasoning extends to scripted uses X-<.
The set of people that script "git grep" may in fact be pretty low /
almost non-existent so it may be a non-issue, but here's my one data
point:
For git-cola, this change in behavior would not make any difference.
It already jumps to the top-level during startup so its grep feature
is unaffected.
It'd be good to hear from other script writers but that's my $.02.
--
David
On Thu, Oct 24, 2013 at 12:40:44PM -0700, Junio C Hamano wrote:
Jeff King [off-list ref] writes:
quoted
That would also provide people who do not like the change of default an
escape hatch to keep the current behavior. And I do not think scripted
use will be inconvenienced; they will already have to use "." or ":/" to
be explicit (if they care) since the behavior is changing.
There is a big difference between "scripted use will have an escape
hatch" and "scripted use will not be inconvenienced".
I think my communication may have been muddled in transit. What I meant
regarding inconvenienced was "not any more so than by simply changing
the behavior in the first place, since scripts already will need to
start becoming explicit due to the behavior change".
And for the "escape hatch", I did not mean for scripts. I actually meant
for users who do not like the extra typing and complain "stupid git, I
always want '.'; you used to do what I want and now you do not".
Even if we ignore the "helping your colleague at her terminal", cf.
http://thread.gmane.org/gmane.comp.version-control.git/133570/focus=133683
FWIW, I have never agreed with that line of reasoning. I was going to
explain why, but I see that I already did in response to the article you
linked. :)
issue for now, adding a new configuration variable from day one
makes the transition of scripts somewhat worse, I am afraid. Doing
so robs us a way to add such an annoying warning to help people
foresee problems in their existing scripts before the default
changes (the configuration presumably will disable the "this command
line will behave differently after the default changes" warning).
If you want to have an annoying warning, why not consider the config a
tristate? Do X or do Y, or if unset, do X with an annoying warning
(which will switch to Y in the future). That does not help a user who
sets the variable after seeing the warning the first time, then later
runs a script that silently chooses the wrong behavior.
But neither does a warning that is squelched by advice.*, which the user
will also set soon after seeing it.
The only way to hit those scripts is to yell at the user anytime the
appropriate command-line override is not selected, with no way to turn
it off. That's what we're doing now with "git add". I think people find
it a little annoying. But perhaps it is the least of all evils.
Anyway, I have said my piece, and I think we are on the same page with
the tradeoffs (what they are, though we may value them differently). I
do not care that strongly about the config option these days; as I said,
it was something I would have used in certain workflows, but I do not
foresee myself even setting it these days. So I am willing to forego it
if there are concerns it will make things worse.
-Peff
On Fri, Oct 25, 2013 at 11:37 AM, Jeff King [off-list ref] wrote:
On Thu, Oct 24, 2013 at 12:40:44PM -0700, Junio C Hamano wrote:
quoted
Jeff King [off-list ref] writes:
quoted
That would also provide people who do not like the change of default an
escape hatch to keep the current behavior. And I do not think scripted
use will be inconvenienced; they will already have to use "." or ":/" to
be explicit (if they care) since the behavior is changing.
There is a big difference between "scripted use will have an escape
hatch" and "scripted use will not be inconvenienced".
I think my communication may have been muddled in transit. What I meant
regarding inconvenienced was "not any more so than by simply changing
the behavior in the first place, since scripts already will need to
start becoming explicit due to the behavior change".
And for the "escape hatch", I did not mean for scripts. I actually meant
for users who do not like the extra typing and complain "stupid git, I
always want '.'; you used to do what I want and now you do not".
Such an escape hatch may be better done as an alias than a config key
(an alias is a config key anyway). I know it won't be easy to "add '.'
if no pathspecs are given", using shell script. But that's something
we could improve, hopefully. An option is we could just export
PATHSPEC_PREFER_* flags via a command line (like --literal-pathspecs).
--
Duy