From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 2/4] add -u: get rid of "treewideupdate" configuration
Date: Fri, 08 Apr 2011 12:27:05 -0700 [thread overview]
Message-ID: <7vaag04k8m.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <20110408175149.GA3917@sigill.intra.peff.net> (Jeff King's message of "Fri, 8 Apr 2011 13:54:32 -0400")
Jeff King <peff@peff.net> writes:
>> What remains is the downside of the configuration variable,
>> namely, that it makes git behave differently depending on who you are and
>> in which repository you are using it, hence making it harder to help
>> and/or teach others.
>
> I have never been a fan of this reasoning. Sure, it is slightly harder
> to help people when the system is configurable. But dropping
> configurability comes at the cost of people who are using the system
> day-to-day. And isn't making it pleasant to use every day more important
> than the minority of times you are telling somebody else how to use it?
I probably should stated it differently. I dropped it during this round
because they are _not_ needed to help the transition, but it is a possible
additional feature.
Let me try to explain the train of throught a bit better.
People seem to expect "add -u" without any pathspec to work on the whole
working tree structure even when you are in a subdirectory, similar to
"git commit -a". We will be changing "add -u" in the longer term to do
so.
After the transition happens, people can easily say "add -u ." to limit it
to the current subdirectory, and people can say "add -u ." even today to
be explicit (which would help them transitioning).
Before the transition, however, there is no pleasant way to cause "add -u"
to add everything when you work in a subdirectory, short of saying:
(cd $(git rev-parse --show-cdup)/. && git add -u)
With ":/", we gain an easy way, "git add -u :/", to say "whole tree".
That is the only thing this series does.
Up to this part, I think we both agree are good thing.
Now, imagine you were born in a world where we had the :/ magic from day
one of git. Different commands "git add -u", "git grep", "git ls-files"
without pathspec operate differently, and for some reason (e.g. usability,
similarity to other people's corresponding command, or historical reasons)
some of them operate only within the current subdirectory while others
operate on the whole tree. The default behaviour might even be different
between versions of git or user configuration.
Because we assume that you already have both "." and ":/" to easily be
explicit in that world, "teachers and helpers may have to scratch there
head wasting their time" is no longer an issue. If you are teaching
others, you ought to know about "." and ":/", and whether we add the
configuration mechanism or not, you ought to know that you should be
explicit to protect yourself from the differences between 1.7.X and 1.8.0
versions in the first place.
So I agree that "costs teachers and helpers" is much less of an issue.
You can certainly introduce configuration variables e.g. "addu.treewide",
"grep.treewide", "lsfiles.treewide" (or even "core.treewide" to cover them
all) to change the default behaviour for each user or each repository.
The real question would become: if it is worth the maintenance cost of
additional code to help users who want to avoid typing "." (or ":/") all
the time in the environment they control. I don't know the answer to this
question yet.
A good new is that we had to conflate the discussion with "but there is no
pleasant way to tell 'default to local' commands to work on the whole
tree" justification for configuration variables before ":/". With ":/",
that excuse will be gone and the discussion can be much more simplified.
next prev parent reply other threads:[~2011-04-08 19:27 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-07 1:16 [PATCH 0/4] Redoing the "add -u" migration plan Junio C Hamano
2011-04-07 1:16 ` [PATCH 1/4] magic pathspec: add tentative ":/path/from/top/level" pathspec support Junio C Hamano
2011-04-07 1:40 ` Junio C Hamano
2011-04-07 13:09 ` Nguyen Thai Ngoc Duy
2011-04-07 18:28 ` Junio C Hamano
2011-04-08 11:39 ` Nguyen Thai Ngoc Duy
2011-04-07 13:23 ` Nguyen Thai Ngoc Duy
2011-04-07 16:18 ` Junio C Hamano
2011-04-08 12:00 ` Nguyen Thai Ngoc Duy
2011-04-08 15:05 ` Junio C Hamano
2011-04-08 15:39 ` Nguyen Thai Ngoc Duy
2011-04-08 16:37 ` Junio C Hamano
2011-04-08 17:02 ` Nguyen Thai Ngoc Duy
2011-04-07 1:16 ` [PATCH 2/4] add -u: get rid of "treewideupdate" configuration Junio C Hamano
2011-04-08 17:54 ` Jeff King
2011-04-08 19:27 ` Junio C Hamano [this message]
2011-04-08 20:24 ` Jeff King
2011-04-08 22:22 ` Junio C Hamano
2011-04-08 22:32 ` Jeff King
2011-04-08 22:37 ` Junio C Hamano
2011-04-08 23:18 ` Junio C Hamano
2011-04-09 4:38 ` Nguyen Thai Ngoc Duy
2011-04-09 4:56 ` Junio C Hamano
2011-04-09 5:05 ` Nguyen Thai Ngoc Duy
2011-04-09 21:34 ` Junio C Hamano
2011-04-09 4:58 ` Nguyen Thai Ngoc Duy
2011-04-09 5:20 ` Junio C Hamano
2011-04-09 10:15 ` Nguyen Thai Ngoc Duy
2011-04-09 11:24 ` Nguyen Thai Ngoc Duy
2011-04-09 21:38 ` Junio C Hamano
2011-05-03 7:52 ` Nguyen Thai Ngoc Duy
2011-05-03 15:01 ` Junio C Hamano
2011-05-03 16:17 ` Nguyen Thai Ngoc Duy
2011-04-07 1:16 ` [PATCH 3/4] add: make "add -u/-A" update full tree without pathspec (step 2) Junio C Hamano
2011-04-07 1:16 ` [PATCH 4/4] add: make "add -u/-A" update full tree without pathspec (step 3) 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=7vaag04k8m.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
/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.